COMPENG 2SI4 Lecture 2: Math Review and Binary Search
68 views3 pages
7 Feb 2017
School
Department
Course
Professor
Document Summary
Ordered arrangement of a number of objects. If there are n distinct elements there are n! The modulus function returns the remainder after dividing two integer. Say we have 10 modulo 8 this gives an answer of 2. In java this operation is written as 10%8. The above series diverges as n goes to infinity but it can be shown that: And therefore we can say that the series diverges logarithmically as n approaches infinity. Sum of consecutive numbers raised to the same power. Given an array of elements that is already in memory. Given a search key that is of the same type as the elements in the array. Find the element in the array, if any, that matches the search key. Compare the search key to each element in the array. Move sequentially from the beginning towards the end. Continue to iterate through the loop until a match is found or the array has ended.