Binary search runs in O(log n) time.
Michael George Tuesday March 29, 2005
This is a proof that binary search runs in O(log n) time. Here is the code: binsearch (A, x, a, b) if b = a then return false
Threads and Concurrency
Announcements
ACSU final general meeting of the year
Wed 4/25, 5pm, Upson Lounge (117) Speaker: Gun Sirer on P2P networks Free food!
Online course evaluations are availa
Balanced Search Trees
Prelim tonight!
Lecture 22 CS211 Spring 2007
Some Search Structures
Sorted Arrays
Advantages
Search in O(log n) time (binary search)
Balanced Search Trees
Best of both!
S
Prelim 2 Reminder
Prelim 2 Prelim 2 Review Session
Sunday 4/15,1:30-3:00pm Kimball B11 Individual appointments are available if you cannot attend the review session (email one TA to arrange appointmen
Generic Types in Java 5 Generic Types and the Java Collections Framework
When using a collection (e.g.,
LinkedList, HashSet, HashMap), we generally have a
single type T of elements that we store in i
The Bag Interface
Priority Queues and Heaps
interface Bag<E> { void put(E obj); E get(); /extract some element boolean isEmpty(); }
Lecture 16 CS211 Spring 2007
Examples: Stack, Queue
Stacks and Qu
Abstract Data Types (ADTs) Standard ADTs
A method for achieving abstraction for data structures and algorithms ADT = model + operations Describes what each operation does, but not how it does it Lectu
Announcements Iteration & Inner Classes
Prelim tonight!
Lecture 14 CS211 Spring 2007
2
Recall: Linear Search
boolean linearSearch(Comparable[] a, Object v) { for (int i = 0; i < a.length; i+) { if
Compiling for Different Platforms
Program written in some high level language (C, Fortran, ML, .) Compiled to intermediate form
Under the Hood: The Java Virtual Machine
Lecture 24 CS211 Spring 20