Topic 13 - Sample Questions -
Sorting and Searching (10 days)
-
Write a Linear search - return index of where name is or a -1 if it is not there
int search(String [] ar, int ct, String na)
- Write a binary search - return index of where name is or a -1 if it is not there
int binarysearch(String [] ar, int ct, String na)
-
Write a bubble sort-
void sort(String [] ar, int ct)
-
Write a selection sort-
void sort(String [] ar, int ct)
-
Write a insertion sort-
void sort(String [] ar, int ct)
-
Write a mergesort sort-
void sort(String [] ar, int ct)
-
Write a quicksort sort-
void sort(String [] ar, int ct)