300 likes | 595 Views
COSC2006 - Data Structures I. Review & Final Exam. Topics. Review Final Exam. Review. Software Engineering Problem Solving Software Life Cycle Modular Design OO Design Top Down Design Structure Chart. Review. Recursion Recursion and Iteration Recursion Examples
E N D
COSC2006 - Data Structures I Review & Final Exam
Topics • Review • Final Exam
Review • Software Engineering • Problem Solving • Software Life Cycle • Modular Design • OO Design • Top Down Design • Structure Chart
Review • Recursion • Recursion and Iteration • Recursion Examples • How to trace recursion • Run-time Stack • Recursion Problem
Review • ADT • Concepts • How to define a ADT? • Array-based ADT List
Review • Linked List • Comparison with Array • Object & Reference • Referenced-based LL • LL operations: • Insertion • Deletion • Traverse • LL-based ADT List • Variation of LL • Doubly LL
Review • Stack • Characteristics of ADT Stack • Stack Applications • Bracket balancing • Stack operations • Stack implementation • Array-based • LL-based • ADT List-based • More Detail Examples • Evaluating postfix, prefix • Convert from infix to postfix
Review • Queue • Characteristics of ADT Queue • Queue Applications • Convert digit to decimal • Palindrome • Queue operations • Queue implementation • Array-based • LL-based • ADT List-based • Queue Applications
Review • Efficiency • Big-O • Searching • Linear search • Binary Search • Sorting • Three O(n2) • Bubble sort • Insertion sort • Selection sort
Review • Efficiency • Sorting • Merge Sort • Quick Sort • Radix Sort
Review • Which of the following is a base case for a recursive binary search algorithm? (first is the index of the first item in the array, last is the index of the last item in the array, and mid is the midpoint of the array). • last > first • first > last • 0 <= first • last <= SIZE-1
Review • A recursive binary search algorithm always reduces the problem size by ______ at each recursive call. • 1 • 2 • half • one-third
Review • An array is a(n) ______. • class • method • object • variable
Review • An ADT’s ______ govern(s) what its operations are and what they do. • specifications • implementation • documentation • data structure
Review • The insertion operation of the ADT list can insert new items ______. • only at the front of the list • only at the end of the list • only in the middle of the list • into any position of the list
Review • Which of the following is true about a constructor in Java? • all constructors have a return type of void • a constructor cannot have parameters • a constructor has the same name as the class • a class can only have a single constructor
Review • The ______ keyword is used to call the constructor of the superclass. • extends • super • this • implements
Review • When you declare a variable that refers to an object of a given class, you are creating a(n) ______ to the object. • interface • reference • Method • ADT
Review • A reference variable whose sole purpose is to locate the first node in a linked list is called ______. • top • front • head • first
Review • Which of the following statements deletes the node that curr references? • prev.setNext(curr); • curr.setNext(prev); • curr.setNext(curr.getNext()); • prev.setNext(curr.getNext());
Review • An array-based implementation of an ADT list ______. • requires less memory to store an item than a reference-based implementation • is not a good choice for a small list • has a variable size • has items which explicitly reference the next items
Review • If the array:6, 2, 7, 13, 5, 4is added to a stack, in the order given, which number will be the first number to be removed from the stack? • 6 • 2 • 5 • 4
Review • Which of the following methods of the ADT stack accepts a parameter? • push • pop • createStack • peek
Review • Typically, ______ are used by a compiler to implement recursive methods. • linked-lists • arrays • Stacks • queues
Review • A reference-based implementation of a queue that uses a linear linked list would need at least ______ external references. • one • two • three • four
Review • Which of the following methods of QueueInterface does NOT throw a QueueException? • enqueue • dequeue • dequeueAll • peek
Review • The Java ______ operator is used to obtain the wraparound effect of a circular array-based queue. • * • + • % • /
Review • If a queue is implemented as the ADT list, which of the following queue operations can be implemented as list.remove(1)? • enqueue() • dequeue() • isEmpty() • peek()
Final Exam • Topics • No specific questions from chapter 1 & 2 • All other parts you have learned in class • Chapter 3, 4, 5, 7, 8, 10 • Class Notes • Tutorials (the solutions are on-line) • Assignments
Final Exam • Time: Wednesday, Dec 16, 2:00 pm • Place: EW206 • Format • 20 multiple choices (30%) • Short Answer Questions (~40%) • Programming Questions (~30%)