This preview shows pages 1–5. Sign up to view the full content.
1
Lecture 25:
Review
PIC 10B
Todd Wittman
Note:
STL will not
be on the final exam.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 2
Final Exam
s
Sunday March 14th
s
Young Hall 24
s
3:006:00 (
Daylight Savings on Sunday!
)
s
The final exam is worth 30% of your grade, same weight
as 2 midterms.
s
Length is also roughly 2 midterms (2 hrs).
s
Very similar in style to practice exams and midterms.
s
Half shortanswer, half longanswer.
s
Emphasis on material covered since last exam
(heaps,
hash tables, sorting)
.
s
Remember to bring your student ID.
3
Data Structures
s
Basic Data Structures
b
Vector
b
Linked List
b
Stack
b
Queue
b
Binary Search Tree
b
Heap
b
Hash Table
Vectors
s
A vector
is the C++ Standard Template Library (STL) class
for storing a list of data in a dynamic array.
Memory
blocks in a vector are sequential, allowing for fast
indexing.
s
Constructor
:
vector<T> myVector
(size)
;
s
Functions
: size()
s
Ex
:
Write a templated function which performs a binary
search on a sorted vector.
Can you make it recursive?
O(N)
O(1)
O(N)
O(logN) if sorted
Erase/Insert
Indexing
Search
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 4
Linked Lists
s
A linked list
is a set of memory blocks, called nodes.
In
a doubly linked list, each node contains a data value and
pointers to the next and previous nodes.
s
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 04/27/2010 for the course PIC 15705120 taught by Professor Wittman during the Winter '10 term at UCLA.
 Winter '10
 Wittman

Click to edit the document details