CSCI 2824 Study Guide - Comprehensive Final Exam Guide - Integer, Old Testament, Pigeonhole Principle
Document Summary
Predicate(n) the part of a sentence that expresses what is said about the subject. In the sentence the child threw the ball, the subject is. The child and the predicate is threw the ball. If max < ai, then max = ai. Procedure linearsearch (x, a1, a2, , an) i = 1. While (i <= n and x ai) i = i+1. If i <= n then location = i. Procedure binarysearch(x, a1, a2, , an) i = 1 # i is left endpoint of search interval j = n # j is right endpoint of search interval. While i < j m = (i+j)/2 # m is index of largest in left list. If x > am then location = i, else location = -1. Return location procedure bubblesort (a1, a2, , an) for i = q to n-1 for j = 1 to n-1.