CSE 1030 Data Structure Mark Shtern Written Test

  • Slides: 20
Download presentation
CSE 1030: Data Structure Mark Shtern

CSE 1030: Data Structure Mark Shtern

Written Test • Different exam (>9) • Wrong Exam Strategy (> 10) • Q

Written Test • Different exam (>9) • Wrong Exam Strategy (> 10) • Q 1 – No auto generate id (>13) – Static is missing (>12) – No super (>6) – No extend (>7) – Public/Private

Written Test • Q 2 – Alias – Deep and Shallow copy (> 20%)

Written Test • Q 2 – Alias – Deep and Shallow copy (> 20%) (Book: pages 313, 822) • Q 3 – Wrong signature (>12) (idea on page 663) • Q 4

Data Structure • Stack is a last in, first out – Push, pop •

Data Structure • Stack is a last in, first out – Push, pop • Queue (FIFO) is collection in which the entities in the collection are kept in order – enqueue: • addition of entities to the rear terminal position – dequeue • removal of entities from the front terminal position • Set • FIFO is acronyms for First In, First Out

Example 01 • Implement a set collection using Linked. List

Example 01 • Implement a set collection using Linked. List

Example 02 • Implement a queue collection using Linked. List

Example 02 • Implement a queue collection using Linked. List

Example 03 • Implement a stack collection using Linked. List

Example 03 • Implement a stack collection using Linked. List

COURSE REVIEW

COURSE REVIEW

Concepts • • • Client vs. Implementer Development cycle UML Delegation Performance

Concepts • • • Client vs. Implementer Development cycle UML Delegation Performance

Classes • Methods • Attributes • Constructor – Copy constructor, constructor chaining, super •

Classes • Methods • Attributes • Constructor – Copy constructor, constructor chaining, super • • Public/Private Class vs Object Interclass Abstract class Generics Javadoc Archietcture

Object • • • State Reference Accessors and Mutators Immutable equals/ hash. Code, compare.

Object • • • State Reference Accessors and Mutators Immutable equals/ hash. Code, compare. To and to. String Clone vs copy constructor Object vs utility this Inheritance

Methods • • • Parameters Return Precondition/Postcondition Exceptions Reuse code, code duplication Initialize Parameters

Methods • • • Parameters Return Precondition/Postcondition Exceptions Reuse code, code duplication Initialize Parameters Attribute shadowing vs overload vs override Early and late binding Static Final

Attribute • • • Primitive type Non primitive type Static Final Attribute Privacy Attribute

Attribute • • • Primitive type Non primitive type Static Final Attribute Privacy Attribute caching

Patterns • • Invocation counter Stamping a serial number Singleton Model-View-Controller

Patterns • • Invocation counter Stamping a serial number Singleton Model-View-Controller

Interface • Methods • Constants • Examples – Serializable – Cloneable – Comparable

Interface • Methods • Constants • Examples – Serializable – Cloneable – Comparable

Aggregation and Composition • Aggregation • Composition • Copy – Alias, shallow, Deep •

Aggregation and Composition • Aggregation • Composition • Copy – Alias, shallow, Deep • Collections • Obligatory methods

Storage • Collections – Map, Set, List • Data Structure – Stack, Queue, Linked.

Storage • Collections – Map, Set, List • Data Structure – Stack, Queue, Linked. List • Arrays • Traversal – Index, iterators

Validation • Exceptions – Checked, unchecked – try, catch, throw, handling multiple exceptions •

Validation • Exceptions – Checked, unchecked – try, catch, throw, handling multiple exceptions • • Error codes Friendly/Message Error handling Assertion Defensive programming

Recursion • Loops vs Recursion • Base cases • Recursive cases

Recursion • Loops vs Recursion • Base cases • Recursive cases

Steps to Class Implementation • Write skeleton contains fields and methods required by API

Steps to Class Implementation • Write skeleton contains fields and methods required by API • Write test harness that tests every feature of the class • Identify private attribute and declare them • Implement constructors, accessors, mutators, methods • Avoid redundancy by delegating and defining private methods • Add new test cases as you implement methods