Benjamin Lin final review

  1. Describe in words how the binary search algorithm works and give a example how it works.
  2. Use pseudo code to describe an algorithm for finding the largest and second largest element in a list
  3. Build a binary search tree for the words, oenology, phrenology, campanology, ornithology, ichthyology, limnology, alchemy, and astrology in alphabetical order

4/5. Find the minimal spanning tree using both breadth first and depth search method starting at point A


  1. 6. Show the step of a quick sort algorithm using the list 3,5,7,8,1,9,2,4,6
    7. consider the algorithm:
    procedure power (a: non zero real number, n: negativeness integer)
    if n = 0 then return 1
    else return a * power(a,n-1)

    what is the purpose of this code and prove that this algorithm is correct using induction.

This entry was posted in Final Exam Review. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *