exercise5 - 5.1). The code for the linked list is provided...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Algorithm and Data Structures Assignment 5 Dr. Andreas N¨uchter Fall 2009 Exercise 5.1 – Program sorter Write a sorting program using C/C++ with the name sorter , that 1. accepts up to 32 integers as command line parameter. 2. displays a help message, in case no parameters, more than 32 parameters, or non-integer numbers are given. 3. uses bubble sort, if the parameter -b is set. Otherwise it uses insert sort. 4. prints nothing to the screen, if the parameter -q is set. 5. prints the numbers in a sorted fashion to the console stating with the smallest number. Examples: % sorter 5 9 -2 150 -95 23 2 5 80 -95 -2 2 5 5 9 23 80 150 % sorter usage: sorter [-b] [-q] number1 [number2 . .. ] (maximum 32 numbers) For writing your sorter program, use the provided Makefile . 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Exercise 5.2 – Program quicksorter This program is a variation of the sorting program of the previous exercise. It is supposed to have the following functionality: Use a linked list to save the numbers. Therefore, we drop the limit of 32 numbers (see exercise
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 5.1). The code for the linked list is provided with the Fles linked list.c and linked list.h • Use quicksort as sorting algorithm. • Link the provided memory check tool (Fle memcheck.c ) to your program and test if your program has a memory leak! ±or solving this exercise a Makefile and a test script will be provided. Please make sure that your program successfully completes the tests. Please send your solutions via email to andreas@nuechti.de . The deadline is October 8th, 8 am and will not be extended! Late homework will not be accepted. Please work in pairs! This programming exercise sheet will count as two written assignment sheets. ±urthermore, to receive credits you have to present and explain your program to the TAs (±lavia Grosan and Vladislav Perelman). ±or doing so, please sign in the list at my o²ce door (Research I, Room 105). 2...
View Full Document

This note was uploaded on 05/04/2010 for the course CS 320251 taught by Professor Nuechter during the Fall '09 term at Jacobs University Bremen.

Page1 / 2

exercise5 - 5.1). The code for the linked list is provided...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online