Download presentation
Presentation is loading. Please wait.
1
CSE 250: Data Structures Week 2 January 21 – 25, 2008
2
Monday - Announcements No classes meet Monday Recitations begin this week.
3
Wednesday - Announcements Pick up syllabus Hand in completed signature form Drop class if you don’t have prerequisites Homework 1 posted Friday 1/25 is the last day to drop/add Spring 2008 classes.
4
Wednesday – Game Plan Recursive Algorithm needed for HW Fun with vectors Fun with Pointers
5
Wednesday Vector is a “growable array” from the C++ libraries. Preferable to use over built-in native C++ arrays. Should use iterator to cycle through the elements of a vector.
6
Wednesday Important iterator methods: begin() end() ++ advances the iterator *nameOfIterator accesses the element that the iterator is currently pointing to
7
Wednesday Pointers Pointers underlie Java’s references, in C++ we are allowed to directly manipulate these structures. Using them is roughly the same as using references. We create a pointer to an object (which starts off pointing to “nothing” – but not initialized to null like Java.
8
Wednesday Assign the pointer to a new instance We can access the value by deferencing the pointer. Look for help from Binky!
9
Friday Announcements Pick up syllabus Sign and turn in last page Homework 1 posted – due 2/1 Today is the last day to drop/add
10
Friday – Game Plan Review linear structures
11
Friday Linked lists Circular – last element has a link to the first Doubly-linked – links in both directions Sorted – change insertion strategy Build upon array or use dynamic links Stacks LIFO Build on other structure (like list) push, pop, and peek only available to user of stack
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.