Sorting & Searching SUB TOPICS : Bubble Sort Selection Sort Insertion Sort Quick Sort Merge Sort Linear Search Binary Search Interpolation Search Sorting • Sorting needs to speed up searching operation in a list. • Sorting type: – Ascending – Descending Sorting algorithm: 1. Internal sorting All data to be sorted are loaded to RAM 2. External sorting Sorting process using secondary storage • Simple: – Bubble sort – Selection sort – ...
FILE PROCESSING SUB TOPICS : Files and Streams File Definition Open File Close File Input File Output File Files and Streams Streams Definition • To keep key in data from keyboard need to be saved at secondary storage device as a data file. • Stream is a sequence of character. All input and output data is a stream. C sees file as a stream. • When a C program run, there are three (3) standard streams activated: 1. Standard Input Stream Controlling input stream from keyboard 2. Standard Output Stream Controlling output stream to the monitor 3. Standard Error Stream Controlling the error messaging • Each stream associated with a file. File Definition • File is a collection of record • ...