Lec24

# Lec24 - Lecture 24: Standard Template Library &amp; Review...

This preview shows pages 1–10. Sign up to view the full content.

1 Lecture 24: Standard Template 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
3 Iterators have been overloaded to look like pointers.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4
5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6
7 Final Exam s Sunday March 15th s 3:00-6:00 s Young Hall 24 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 short-answer, half long-answer. s Emphasis on material covered since last exam (heaps, hash tables, sorting) . s Remember to bring your student ID.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
8 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
9 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 preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/19/2011 for the course PIC 10B taught by Professor Wittman during the Winter '08 term at UCLA.

### Page1 / 13

Lec24 - Lecture 24: Standard Template Library &amp; Review...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online