Top Banner
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 Data Structures Course Review FINAL
59

Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Jul 06, 2018

Download

Documents

phungcong
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: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Nirmalya Roy

School of Electrical Engineering and Computer ScienceWashington State University

Cpt S 122 – Data Structures

Course ReviewFINAL

Page 2: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Final

When: Wednesday (12/12) 1:00 pm -3:00 pm Where: In Class

Closed book, Closed notes Comprehensive

Material for preparation: Lecture Slides Quizzes, Labs and Programming assignments Deitel & Deitel book (Read and re-read Chapter 15 to 22

and Chapter 24 and the last 5 weeks lecture notes from course webpage)

Page 3: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Overview (First 5 weeks)

Functions (Chapter 5)

Function Call Stack and Stack Frames

Pass-by-value and Pass-by-reference

Pointers (Chapter 7)

Pointer Operators

Passing Arguments to Functions by Reference

const qualifiers with Pointers

Characters and Strings (Chapter 8)

Fundamentals of Strings and Characters

Page 4: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Overview

Data Structures (Chapter 12)

Self Referential Structures

Dynamic Memory Allocation

Linked Lists, Stacks and Queues insert, delete, isEmpty, print

Binary Trees, Binary Search Trees

Tree Traversals preOrder, inOrder, postOrder

Page 5: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Overview (Second 5 weeks)

C++ as a better C; Introducing Object Technology (Chapter 15)

Inline Function

Function Overloading and Function Templates

Pass-by-value and Pass-by-reference

Introduction to Classes, Objects & Strings (Chapter 16) Data members, Members functions, set and get functions

Constructors

Classes: A Deeper Look, Part I (Chapter 17)

Separating interface from implementation

Destructors

Page 6: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Overview

Classes: A Deeper Look, Part 2 (Chapter 18) const Objects and const Member functions

Composition: Objects as members of class

friend function and friend class

this pointer

Operator Overloading; Class String (Chapter 19)

Implementation of operator overloading

Dynamic memory management using new operator

Explicit constructor

Page 7: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Overview

Object Oriented Programming: Inheritance (Chapter 20)

Base Classes & Derived Classes

public, protected, and private Inheritance

Object Oriented Programming: Polymorphism (Chap. 21)

Abstract Classes & pure virtual Functions

virtual Functions & Dynamic Binding

Polymorphism & RunTime Type Information (RTTI)

downcasting, dynamic_cast

virtual Destructors

Page 8: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Overview

Templates (Chapter 22)

Function Template

Class Templates

STL Containers: example of container class template such as stack

Exception Handling (Chapter 24)

Use of try, catch and throw to

detect, handle and indicate exceptions, respectively.

Exception handling with constructors & destructors

Processing new failures

Page 9: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Overview (Last 5 weeks)

Templatized Linked List insert, delete, isEmpty, printList

Templatized Stack push, pop, top, isStackEmpty, printStack

Templatized Queue enqueue, dequeue, isQueueEmpty, printQueue

Templatized Tree insertNode, preOrder, inOrder, postOrder

Page 10: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Overview (Last 5 weeks)

Sorting algorithms and Runtime analysis

Bubble sort, Selection sort, Insertion sort, Shell sort, Merge sort, Quick sort

Enumeration of sorting algorithms in practice

Standard Template Library

Containers, Iterators, Algorithms

Abstract Data Types vector, list, stack, queue

Runtime complexity

Page 11: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

C++ enables several functions of the same name to be

defined, as long as they have different signatures.

This is called function overloading.

The C++ compiler selects the proper function to call

examining the number, types and order of the arguments in the

call.

Overloaded functions are distinguished by their signatures.

A signature is a combination of a function’s name and its parameter types (in order).

Function overloading is used to create several functions of

the same name

perform similar tasks, but on different data types.

Function Overloading

Page 12: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Overloaded functions normally perform similar or identical

operations on different types of data.

If the operations are identical for each type, they can be

expressed more compactly and conveniently using function

templates.

Function Templates

Page 13: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

With object-oriented programming, we focus on the

commonalities among objects in the system rather

than on the special cases.

We distinguish between the is-a relationship and the

has-a relationship.

The is-a relationship represents inheritance.

In an is-a relationship,

an object of a derived class can be treated as an object of its

base class.

By contrast, the has-a relationship represents

composition.

Inheritance

Page 14: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Dynamic Memory Management

Use the new operator to dynamically allocate (i.e., reserve) the exact amount of memory required to hold an object or array at execution time.

Once memory is allocated in the free store, you can access it via the pointer that operator new returns.

To destroy a dynamically allocated object, use the

delete operator as follows: delete ptr;

To deallocate a dynamically allocated array, use the

statement delete [] ptr;

Page 15: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Polymorphism

Polymorphism

Compile time Polymorphism

Runtime Polymorphism

Function Overloading

OperatorOverloading

VirtualFunctions

early binding, or static

binding, or static linking

late binding, or

dynamic binding,

virtual function

Page 16: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

A class is made abstract by declaring one or more of its virtualfunctions to be “pure.”

A pure virtual function is specified by placing “= 0” in its

declaration, as in

virtual void draw() const = 0;

Abstract classes are classes from which you never intend to instantiate any objects.

Classes that can be used to instantiate objects are called concrete classes.

Abstract Classes and pure virtual Functions

Page 17: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Exception Handling

What is exception handling?

Example: Handling an attempt to divide by zero

Use try, catch and throw to detect, handle and indicateexceptions, respectively.

Rethrowing an exception

Exception Specifications

Processing unexpected and uncaught exceptions

Processing new failures

Dynamic memory allocation

Use unique_ptr to prevent memory leak

Page 18: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

try blocks enable exception handling.

The try block encloses statements that might cause exceptions and statements that should be skipped if an exception occurs.

Exceptions are processed by catch handlers (also called exception handlers), which catch and handle exceptions.

At least one catch handler must immediately follow each try block.

Exception Handling (cont.)

Page 19: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Last 5 Weeks

Templated Classes

Sorting and Algorithm Analysis

Standard Template Library (STL)

Abstract Data Type

Runtime Complexity

Page 20: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

ListNode Template Class

Page 21: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

List Class Template

Page 22: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

List Class Constructor

Page 23: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

List Class Destructor

Page 24: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

insertAtFront() & Runtime

Page 25: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

insertAtBack() & Runtime

Page 26: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

removeFromFront() & Runtime

Page 27: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

removeFromBack() & Runtime

Page 28: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

isEmpty() & Runtime

Page 29: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Templated Linked List Problem

Please write a insertNode() method for the class List. This method should insert data in the list in order.

First create a new node with the provided value.

Make sure to check if the list is empty and if so set the pointers appropriately to insert the new node into the empty list.

Otherwise traverse the list by advancing a current pointer, compare the new Node’s value with the existing ListNode’s data to find the correct position and then set the pointers appropriately to insert the new node considering the following 3 cases insertAtFront

insertInBetween

insertAtBack

Page 30: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Option 1: Implement a stack class primarily by reusing a list class.

private inheritance of the list class.

Option 2: Implement an identically performing stack class through composition

a list object as a private member of a stack class.

Templated Stack

Page 31: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

List Class is Given

Page 32: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Templated Stack derived from class List

runtime of push, pop, isStackEmpty,

printStack??

Page 33: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Templated Stack (cont.)

Page 34: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Queue Class Template

runtime of enqueue, dequeue,

isQueueEmpty, printQueue??

Page 35: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Queue Class Template

Page 36: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Linked lists, stacks and queues are linear data structures.

A tree is a nonlinear, two-dimensional data structure.

arrays arrange data linearly, binary trees can be envisioned as

storing data in two dimensions

Tree nodes contain two or more links.

trees whose nodes all contain two links (none, one or both of

which may be null).

Trees

Page 37: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

TreeNode Class Template

Page 38: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

ListNode Member Function

Page 39: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

TreeNode Class Template (cont.)

Page 40: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Tree Class Template (cont.)

Page 41: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Tree Class Template (cont.)

Page 42: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Tree Class Template (cont.)

Page 43: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Tree Class Template preorder Traversal

preOrder traversal is: root, left, right

Page 44: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Tree Class Template inOrder Traversal

inOrder traversal is: left, root, right

Page 45: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Tree Class Template postOrder Traversal

postOrder traversal is: left, right, root

Page 46: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Other Binary Tree Operations

The level order traversal of a binary tree visits the nodes

of the tree row-by-row starting at the root node level.

On each level of the tree, the nodes are visited from left to right.

The level order traversal is not a recursive algorithm.

Implement the level order binary tree traversal using a

common data structure we have discussed in the class.

Write the pseudo code of this algorithm.

Page 47: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Level Order Binary Tree Traversal

Use the Queue data structure to control the output of the level order binary tree traversal.

Algorithm

Insert/enqueue the root node in the queue

While there are nodes left in the queue, Get/dequeue the node in the queue

Print the node’s value

If the pointer to the left child of the node is not null

Insert/enqueue the left child node in the queue

If the pointer to the right child of the node is not null

Insert/enqueue the right child node in the queue

Page 48: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Problem in Tress

Given the preOrder, inOrder or postOrder traversals of a binary tree, draw the binary tree.

preOrder: 27 13 6 17 42 33 48

inOrder: 6 13 17 27 33 42 48

postOrder: 6 17 13 33 48 42 27

Page 49: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Problem in Trees

Draw the a binary search tree after inserting the following sequence of values using the insertNode() method from the tree class:

50, 25, 12, 6, 13, 33, 75, 67, 68, 88

Page 50: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Sorting Algorithms

Bubble sort Worst case Runtime O(?)

Insertion sort Worst case Runtime O(?)

Selection sort Worst case Runtime O(?)

Shell sort Worst case Runtime O(?)

Merge sort Worst case Runtime O(?)

Quick sort Worst case Runtime O(?)

Which one is best at least theoretically?

Which one is best in practice and Why?

Page 51: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Comparison of Sorting Algorithms

Selection Sort (N2) (N2) (N2) Best Case

is quadratic

Bubble Sort (N2) (N2) (N)

Page 52: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Enumeration of Sorting Algorithms

Try the insertion sort, selection sort, shell sort, merge sort and quick sort, algorithm on the following list of integers for example:

{7, 3, 9, 5, 4, 8, 0, 1}

Page 53: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Standard Template Library (STL)

ContainersIterators

Algorithms

Page 54: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Abstract Data Types (ADTs)

ADT is a set of objects together with a set of operations Abstract

implementation of operations is not specified in ADT definition

E.g., List

Operations on a list: Insert, delete, search, sort

C++ class are perfect for ADTs

Can change ADT implementation details without breaking code that uses the ADT

Page 55: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Lists Using STL

Two popular implementation of the List ADT

The vector provides a growable array implementation of the List ADT Advantage: it is indexable in constant time

Disadvantage: insertion and deletion are computationally expensive

The list provides a doubly linked list implementation of the List ADT Advantage: insertion and deletion are cheap provided that the

position of the changes are known

Disadvantage: list is not easily indexable

Vector and list are class templates

Can be instantiated with different type of items

Page 56: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Lists Using STL (cont’d)

vector<Object>

Array-based implementation

findKth – O(1)

insert and remove – O(N) Unless change at end of vector

list<Object>

Doubly-linked list with sentinel nodes

findKth – O(N)

insert and remove – O(1) If position of change is known

Both require O(N) for search

Page 57: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Course Evaluations

Please take a few minutes to complete the online course evaluations available at https://skylight.wsu.edu/student/

Thank you for taking CptS 122.

Page 58: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Tentative Final Structure

Part I: Conceptual Questions (45pts) Multiple Choice, Fill-in-the-blank, and True/False

Go though the self-review exercises at the end of each chapter

Part II: Programming Questions (35pts) Write Templated C++ code for Linked List, Stack, Queue and

Tree

Retake Quiz 1 to Quiz 6

Part III: Enumerative and Pseudo code Questions (20pts) Workout all the sorting algorithm on an example input set

Remember the time complexity

Practice preOrder, inOrder, postOrder & level-order traversal algorithm

Page 59: Cpt S 122 Data Structures Course Review FINALeecs.wsu.edu/~nroy/courses/cpts122/notes/Review_Final.pdf · Bubble sort, Selection sort, Insertion sort, ... Comparison of Sorting Algorithms

Good Luck !