cosc2006 - data structures i
DESCRIPTION
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 - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/1.jpg)
COSC2006 - Data Structures I
Review & Final Exam
![Page 2: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/2.jpg)
2
Topics
Review Final Exam
![Page 3: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/3.jpg)
3
Review Software Engineering
Problem Solving Software Life Cycle Modular Design
OO Design Top Down Design
Structure Chart
![Page 4: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/4.jpg)
4
Review Recursion
Recursion and Iteration Recursion Examples How to trace recursion
Run-time Stack Recursion Problem
![Page 5: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/5.jpg)
5
Review ADT
Concepts How to define a ADT? Array-based ADT List
![Page 6: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/6.jpg)
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
![Page 7: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/7.jpg)
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
![Page 8: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/8.jpg)
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
![Page 9: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/9.jpg)
9
Review Efficiency
Big-O Searching
Linear search Binary Search
Sorting Three O(n2)
Bubble sort Insertion sort Selection sort
![Page 10: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/10.jpg)
10
Review Efficiency
Sorting Merge Sort Quick Sort Radix Sort
![Page 11: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/11.jpg)
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
![Page 12: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/12.jpg)
12
Review A recursive binary search algorithm
always reduces the problem size by ______ at each recursive call. 1 2 half one-third
![Page 13: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/13.jpg)
13
Review An array is a(n) ______.
class method object variable
![Page 14: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/14.jpg)
14
Review An ADT’s ______ govern(s) what its
operations are and what they do. specifications implementation documentation data structure
![Page 15: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/15.jpg)
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
![Page 16: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/16.jpg)
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
![Page 17: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/17.jpg)
17
Review The ______ keyword is used to call the
constructor of the superclass. extends super this implements
![Page 18: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/18.jpg)
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
![Page 19: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/19.jpg)
19
Review A reference variable whose sole purpose
is to locate the first node in a linked list is called ______. top front head first
![Page 20: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/20.jpg)
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());
![Page 21: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/21.jpg)
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
![Page 22: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/22.jpg)
22
Review
If the array: 6, 2, 7, 13, 5, 4 is 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
![Page 23: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/23.jpg)
23
Review Which of the following methods of the ADT
stack accepts a parameter? push pop createStack peek
![Page 24: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/24.jpg)
24
Review Typically, ______ are used by a compiler
to implement recursive methods. linked-lists arrays Stacks queues
![Page 25: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/25.jpg)
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
![Page 26: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/26.jpg)
26
Review Which of the following methods of
QueueInterface does NOT throw a QueueException? enqueue dequeue dequeueAll peek
![Page 27: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/27.jpg)
27
Review The Java ______ operator is used to
obtain the wraparound effect of a circular array-based queue. * + % /
![Page 28: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/28.jpg)
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()
![Page 29: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/29.jpg)
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
![Page 30: COSC2006 - Data Structures I](https://reader036.vdocuments.mx/reader036/viewer/2022062314/5681351d550346895d9c79a9/html5/thumbnails/30.jpg)
30
Final Exam
Time: Wednesday, Dec 16, 2:00 pm Place: EW206 Format
20 multiple choices (30%) Short Answer Questions (~40%) Programming Questions (~30%)