Tutorial 4-1

Tutorial 4-1 - CS 134 Tutorial 4: ADTs and Linked Lists CS...

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

View Full Document Right Arrow Icon
CS 134 Tutorial 4: ADTs and Linked Lists CS 134 Tutors Winter 2008 1 ADTs 1.1 Properties of ADTs Data space - A set of values that the ADT can take on. Operations - A set of methods that take the ADT to a different state or reveal information about the state. No Implementation - ADTs are abstract and free of implementation. None may be sug- gested or implied. 1.2 ADT Flowchart Please refer to adts.pdf for visual representation of ADTs and their role in CS 134. 1.3 Am I an ADT? 1. (a) A book. (b) A book that can be read. (c) A book that can store stories on specific pages. (d) A book that can store stories and the stories can be read. (e) A book that can store stories and the stories can be read, but the stories are on A4 pages made with B.C. timber, and reading must involve the use of eyeglasses. 2. (a) A person. (b) A person that can be in different places. (c) A person that can walk. (d) A person that can be in different places and can walk. (e) A person that can be in different places and can walk, but the places must be desig- nated by green labels in all caps, and the walking must be in a drunken manner by means of muscle contraction. 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
3. (a) A database. (b) A database that stores tables of relations. (c) A database that allows queries. (d) A database that allows queries of the relations it stores. (e) A database that stores tables of relations using a B-tree and a extendible hashtable for the secondary key and must support queries in O (log k n ) time. 2
Background image of page 2
2 Linked Lists 2.1 Node and DoubleNode Recall that the Node class looks like the following; item next Node public class Node { private Object item; private Node next; public Node(Object newItem) { . .. } public Node(Object newItem, Node nextNode) { . .. } public void setNext(Node nextNode) { . .. } public void setItem(Object newItem) { .
Background image of page 3

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

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

Page1 / 11

Tutorial 4-1 - CS 134 Tutorial 4: ADTs and Linked Lists CS...

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

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