Top Banner
COSC2006 - Data Structures I Review & Final Exam
30

COSC2006 - Data Structures I

Jan 02, 2016

Download

Documents

gannon-douglas

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 Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: COSC2006 - Data Structures I

COSC2006 - Data Structures I

Review & Final Exam

Page 2: COSC2006 - Data Structures I

2

Topics

Review Final Exam

Page 3: COSC2006 - Data Structures I

3

Review Software Engineering

Problem Solving Software Life Cycle Modular Design

OO Design Top Down Design

Structure Chart

Page 4: COSC2006 - Data Structures I

4

Review Recursion

Recursion and Iteration Recursion Examples How to trace recursion

Run-time Stack Recursion Problem

Page 5: COSC2006 - Data Structures I

5

Review ADT

Concepts How to define a ADT? Array-based ADT List

Page 6: COSC2006 - Data Structures I

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

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

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

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

10

Review Efficiency

Sorting Merge Sort Quick Sort Radix Sort

Page 11: COSC2006 - Data Structures I

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

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

13

Review An array is a(n) ______.

class method object variable

Page 14: COSC2006 - Data Structures I

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

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

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

17

Review The ______ keyword is used to call the

constructor of the superclass. extends super this implements

Page 18: COSC2006 - Data Structures I

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

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

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

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

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

23

Review Which of the following methods of the ADT

stack accepts a parameter? push pop createStack peek

Page 24: COSC2006 - Data Structures I

24

Review Typically, ______ are used by a compiler

to implement recursive methods. linked-lists arrays Stacks queues

Page 25: COSC2006 - Data Structures I

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

26

Review Which of the following methods of

QueueInterface does NOT throw a QueueException? enqueue dequeue dequeueAll peek

Page 27: COSC2006 - Data Structures I

27

Review The Java ______ operator is used to

obtain the wraparound effect of a circular array-based queue. * + % /

Page 28: COSC2006 - Data Structures I

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

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

30

Final Exam

Time: Wednesday, Dec 16, 2:00 pm Place: EW206 Format

20 multiple choices (30%) Short Answer Questions (~40%) Programming Questions (~30%)