Linear Search and Hash Tables Topic 9 Linear Search and Hash Tables
Announcements Participation due tomorrow FunSort explanation posted
FunSort FunSort(list, low, high) returns list if (low < high) then FunSort(list, low, high-1) if list[high-1] > list[high] then swap list[high-1] and list[high] end if end FunSort
FunSort TL;DR 5 4 3 2 1 … 3 4 5 2 1
More on Homework 4 Program arguments Images public static void main(String[] args) { for (int i = 0; i < args.length; i++) System.out.println(args[0]); } bash$ java cs345_prog1 hello world hello world Images
Searching Definition:
Searching Unsorted Array
Jump Search
Binary Search
Interpolation/Phonebook Search … 8946 9999
N Log(n) Log(log(n))
Announcements Participation 3 is due Homework 4: questions/issues? Asking Sankar about programming questions.
Participation 3 Minimization of Maximum Regret
Hash Tables Definition:
Division Method
Multiplication Method
MAD (Multiply, Add, and Divide)
Considerations
Collisions
Chaining
Open Addressing
Linear Probing
Quadratic Probing
Double Hashing
Pseudocode
Deletion Chaining
Open Addressing
Runtime Analysis
Universal Hash Function
Perfect Hashing
Announcements Homework 4 due Homework 5 is up
Bloom Filters
Bloom Filter
Hash functions: Computation Key H1 H2
False Positives