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

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

View Full Document Right Arrow Icon
1 Lecture 24: Standard Template PIC 10B Todd Wittman Note: STL will not be on the final exam.
Background image of page 1

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

View Full DocumentRight Arrow Icon
2
Background image of page 2
3 Iterators have been overloaded to look like pointers.
Background image of page 3

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

View Full DocumentRight Arrow Icon
4
Background image of page 4
5
Background image of page 5

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

View Full DocumentRight Arrow Icon
6
Background image of page 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.
Background image of page 7

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

View Full DocumentRight Arrow Icon
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
Background image of page 8
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
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
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 Right Arrow Icon
Ask a homework question - tutors are online