1 / 30

COSC2006 - Data Structures I

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

Download Presentation

COSC2006 - Data Structures I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COSC2006 - Data Structures I Review & Final Exam

  2. Topics • Review • Final Exam

  3. Review • Software Engineering • Problem Solving • Software Life Cycle • Modular Design • OO Design • Top Down Design • Structure Chart

  4. Review • Recursion • Recursion and Iteration • Recursion Examples • How to trace recursion • Run-time Stack • Recursion Problem

  5. Review • ADT • Concepts • How to define a ADT? • Array-based ADT List

  6. 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

  7. 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

  8. 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

  9. Review • Efficiency • Big-O • Searching • Linear search • Binary Search • Sorting • Three O(n2) • Bubble sort • Insertion sort • Selection sort

  10. Review • Efficiency • Sorting • Merge Sort • Quick Sort • Radix Sort

  11. 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

  12. Review • A recursive binary search algorithm always reduces the problem size by ______ at each recursive call. • 1 • 2 • half • one-third

  13. Review • An array is a(n) ______. • class • method • object • variable

  14. Review • An ADT’s ______ govern(s) what its operations are and what they do. • specifications • implementation • documentation • data structure

  15. 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

  16. 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

  17. Review • The ______ keyword is used to call the constructor of the superclass. • extends • super • this • implements

  18. 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

  19. Review • A reference variable whose sole purpose is to locate the first node in a linked list is called ______. • top • front • head • first

  20. 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());

  21. 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

  22. 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

  23. Review • Which of the following methods of the ADT stack accepts a parameter? • push • pop • createStack • peek

  24. Review • Typically, ______ are used by a compiler to implement recursive methods. • linked-lists • arrays • Stacks • queues

  25. Review • A reference-based implementation of a queue that uses a linear linked list would need at least ______ external references. • one • two • three • four

  26. Review • Which of the following methods of QueueInterface does NOT throw a QueueException? • enqueue • dequeue • dequeueAll • peek

  27. Review • The Java ______ operator is used to obtain the wraparound effect of a circular array-based queue. • * • + • % • /

  28. 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()

  29. 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

  30. Final Exam • Time: Wednesday, Dec 16, 2:00 pm • Place: EW206 • Format • 20 multiple choices (30%) • Short Answer Questions (~40%) • Programming Questions (~30%)

More Related