|
12/03/03
|
- One pass min & max
- Read from standard input (keyboard) number of integers that will be given to program
- Read specified number of integers
- Find minimum and maximum among these numbers, do it by going over array only once
- Pairwise sum
- Read from standard input (keyboard) an integer number, let's call it N
- Read N integers
- Read N integers more
- Find pairwise sums and print them out
- For example, if I enter 3 for N, then 1,10,100 and 5,6,7, your program
should sum 1 and 5, 10 and 6, 100 and 7 so output should be 6,16,107
- Binary search
- Read from standard input (keyboard) an integer number, let's call it N
- Read N integers, they will be given in non-decreasing order
- Read one more integer K
- Search for K among N integers that were entered using binary search algorithm
described in Chapter 4
- Report if K was found or not
- Insertion sort
- Read from standard input (keyboard) an integer number, let's call it N
- Read N integers
- Sort them using insertion sort described in Chapter 4
- Print out the resulting ordered array
|