L2 - CSE 12 : Basic data structures and object-oriented...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSE 12 : Basic data structures and object-oriented design Jacob Whitehill jake@mplab.ucsd.edu Lecture Two 2 Aug 2011 Tuesday, August 2, 2011 Review from last lecture In computer science, all data must ultimately be represented as a binary sequence. Data structures are necessary to encode useful information in binary sequences. Data structures may vary in their time complexity, space complexity, and code complexity (human effort). Tuesday, August 2, 2011 Review from last lecture It is important to learn the fundamental data structures of computer science so you dont keep having to rediscover the wheel. The fundamental data structures covered in this course include: lists , stacks , queues , heaps , trees , hash tables , and graphs . Tuesday, August 2, 2011 Fundamental data structures 5 of these structures (list, stack, queue, heap, hash table) are useful as collections to support add / retrieve / remove operations. In coarse English, a collection is useful if the user wants to put data in it, and later pull data out of it. E.g., youre writing a program to manage the Fnancial aid of all UCSD students. You want some structure (collection) to hold all the UCSDStudent objects -- you dont want to manage them yourself. Tuesday, August 2, 2011 Fundamental data structures Different collections have different time and space costs for the add/retrieve/remove operations. Which collection is best depends on which operations your code calls most often. Tuesday, August 2, 2011 Fundamental data structures 2 of these structures (tree, graph) are useful to represent connectivity relationships among data: Trees can represent hierarchical relationships (e.g., heredity). Graphs can represent arbitrary relationships between pairs of data (e.g., Facebook friends). Tuesday, August 2, 2011 Fundamental data structures In this course we will develop all of these data structures as Abstract Data Types (ADTs). In this lecture I hope to: Explain abstraction from a computer systems perspective. Motivate building data structures as ADTs. Introduce our Frst ADT of the course: the list . Tuesday, August 2, 2011 Data structures youre already familiar with. Tuesday, August 2, 2011 Data structures you already know In prior coursework you have already worked with some simple data structures: Arrays : int numbers = new int[100]; ... numbers[5] = 16; Tuesday, August 2, 2011 Data structures you already know In prior coursework you have already worked with some simple data structures: Arrays : collection of related variables speciFed by an index: int numbers = new int[100]; ......
View Full Document

Page1 / 77

L2 - CSE 12 : Basic data structures and object-oriented...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online