/********************************************************************* C201 Fall 2006 Dana Vrajitoru array_oper.h Functions concerning operations on arrays. **********************************************************************/ #ifndef ARRAY_OPER_H #define ARRAY_OPER_H // Outputs the elements of an array. void Output(int *a, int size); // Initializes the elments of the array with random values between 0 // and limit-1 void Random_array(int *a, int size, int limit); // A function that finds the minimum in an array of integers. int Find_min(int *a, int size); // Swaps two integers. void Swap(int &n, int &m); // Selection sort. Finds the minimum in the array and swaps it with // position 0. Then find the next minimum in the array and moves it // to position 1 and so on. void Selection_sort(int *a, int size); //Binary search. Searches for a value in a sorted array. int Binary_search(int *a, int size, int value); #endif