next up previous
Next: About this document ... Up: lab3 Previous: lab3

OPERATING SYSTEMS LABORATORY III - C Review II

  1. Structures; A set of more variables grouped together for convenient handling.
  2. File Input and Output; Examples on how to read from a file and write to a file.
    • http://siber.cankaya.edu.tr/OperatingSystems/cfiles/code11.c code11.c and http://siber.cankaya.edu.tr/OperatingSystems/cfiles/code12.c code12.c.
    • Analyze the code11.c and the output, do not forget also retrieve the file http://siber.cankaya.edu.tr/OperatingSystems/cfiles/datafile datafile.
    • Analyze the code12.c and the output, what is stored into file ``output''?
  3. Assignment I In this assignment, you're to sort a given multi-column unsorted integer file http://siber.cankaya.edu.tr/OperatingSystems/cfiles/unsorted.txt unsorted.txt.
    • The first line of the file contains number of integers and number of columns.
    • According to that information, write a complete C program to sort all the integers in a single-column format(to standart output, or directly to file).
    • Which sorting algorithm?

      Table 1: You should use the following sorting algorithms depending on the last digit of your Student ID.
      Last Digit Algorithm Complexity
      0-1 Bubble sort $O(n^2)$
      2-3 Heap sort $O(nlogn)$
      4-5 Insertion sort $O(n^2)$
      6-7 Merge sort $O(nlogn)$
      8-9 Quick sort $O(nlogn)$


      The last column is just given for information, not relevant for your assignment.
    • You will be asked about your code during lab hour for grading.

next up previous
Next: About this document ... Up: lab3 Previous: lab3
Cem Ozdogan 2009-07-09