Chabot College Fall 2002 Removed Fall 2010 Course Outline Computer Science 20J INTRODUCTION TO DATA STRUCTURES USING JAVA Catalog Description: CS 20J – Introduction to Data Structures Using Java 4 Units Design and implementation of larger projects as Java applications using software engineering principles. Emphasis on definition and use of data structures. Includes specification of Abstract Data Types, general recursion, stacks, linked lists, queues, binary trees, sorting and searching algorithms, hashing techniques. Intended to satisfy ACM guidelines for Computer Science 2 as required for Computer Science and related transfer majors. Prerequisite: Computer Science 19A (completed with a grade of C or higher). 3 hours lecture, 3 hours laboratory. [Typical contact hours: lecture 52.5, laboratory 52.5] Prerequisite Skills: Before entering the course the student should be able to: 1. create, design, implement, debug, test, and document eight to ten Java applications and applets of intermediate length and complexity that use the full range of Java syntax, selected Java classes, user-defined classes (including those that use the various class associations), and standard GUI components, including at least one simple graphical user interface that can respond to events, using the Java development kit (SDK) and/or other integrated development environments such as JBuilder or Visual Café; 2. use various Java core classes including String, System, Math, and wrapper classes to perform standard System input and output, perform numeric calculations and instantiate and manipulate objects of both Java and user-defined classes; 3. manipulate String and StringBuffer objects, arrays and vectors consisting of simple variables or objects; 4. design Java classes that use visibility modifiers and class (static) variables, overloaded constructors, accessor and general methods; 5. design classes and create and use objects of these classes that bear the following relationships: association ("knows a"), aggregation including composition ("has a"), and inheritance ("is a"); 6. demonstrate familiarity with basic exception handling techniques: try-catch and throw; 7. create and implement an interface; 8. extend an abstract base class and explain the difference. Expected Outcome for Students: Upon completion of the course the student should be able to: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. define the term abstract data type (ADT); define a list ADT and implement list ADT as array and vector class; implement list ADT as a singly and doubly linked list class; define a stack ADT and implement stack ADT as array (or vector) and as a linked list; define a queue ADT and implement queue ADT as array (or vector) and as linked list; define a binary tree ADT and implement binary tree class; define a binary search tree ADT and derive a binary search tree class from binary tree class; write recursive methods and explain how recursion is implemented; implement selected iterative and recursive searching and sorting algorithms; design and implement a search that uses a hashing function; explain the concept of time efficiency for algorithms using Big-O notation. Chabot College Course Outline for Computer Science 20J Introduction to Data Structures Using Java Fall Semester 2002 Page 2 Course Content: 1. Data abstraction a. Concept of ADT b. Typical operations on an ADT c. Implementation issues 2. Elementary Search algorithms a. Sequential search b. Binary search c. Time efficiency of algorithms d. Big-O notation and time-behavior e. Simple examples: Time order of sequential and binary search 3. Implementing linear data structure ADTs a. List as array or vector b. List as singly and doubly linked list c. Queue as array, vector or linked list d. Stack as array, vector or linked list e. Big-O time-order of traversal, insertion, and deletion for above data structures f. Applications such as evaluation of postfix (RPN) and infix expressions 4. Recursion a. Base and general case b. Applications such as recursive evaluation of the binomial coefficient and recursive traversal of a linked list c. Stack activation record and its role in implementing recursive calls d. Comparison of recursive and iterative algorithms 5. Implementing binary Tree ADTs a. Basic terminology: leaf, root, level, depth, balanced, full, complete b. Building a binary tree: inserting and deleting nodes c. Binary tree traversals: preorder, inorder, postorder d. Binary search tree e. Building a binary search tree: inserting nodes. Deleting nodes is optional. f. Use of binary search tree to search and sort data g. Complete binary trees: building a heap h. Time order of various binary tree operations 6. Sort algorithms a. Elementary O(n-squared) sorts: InsertionSort, SelectionSort, BubbleSort b. Recursive O(nlog n) sorts: QuickSort, MergeSort, HeapSort 7. Hashing algorithms a. Concept of searching by direct access: Hash tables b. Construction of an elementary hashcode function c. Resolving collision by linear probing and chaining d. Application of hash codes to storage of records in an direct access file or object 8. Designing larger projects a. Class design diagrams b. Industry documentation standards c. Use of inheritance for code reuse d. Top-down and bottom-up design e. Testing issues and techniques Chabot College Course Outline for Computer Science 20J Introduction to Data Structures Using Java Fall Semester 2002 Page 3 Methods of Presentation: 1. Lecture, discussion, and classroom demonstrations 2. Student use of appropriate computer laboratory Assignments and Methods of Evaluating Student Progress: 1. Typical Assignments a. Make the following changes to the class BNTode in the text: 1) change the underlying data type from Objet to String, 2) remove all methods from the class, leaving only the constructor, the isLeaf() method, and the 3 set and 3 get methods. 2. Methods of Evaluating Student Progress a. A minimum of two midterms and a final examination b. Writing and implementation of various assigned programming projects that demonstrate competent knowledge of a range of the topics in the course outline. Design, coding, testing and documentation of at least one project of 500 lines of code or longer. Textbook(s) (Typical): Data Structures and Other Objects Using Java, Main, Addison Wesley, 2000 Special Student Materials: Computer lab fee Diskettes Optional zip disk New: August 29, 2001 Carol Conway and Maurice Ngo CS 20J Outline Fall 2002