Final Exam Preview Chapter 4,5,6,7,8,9. Remember to evaluate CS221  Go to  Ends tonight.

Slides:



Advertisements
Similar presentations
Stacks, Queues, and Linked Lists
Advertisements

CS252: Systems Programming Ninghui Li Program Interview Questions.
Binary Trees CSC 220. Your Observations (so far data structures) Array –Unordered Add, delete, search –Ordered Linked List –??
Data Structures Data Structures Topic #13. Today’s Agenda Sorting Algorithms: Recursive –mergesort –quicksort As we learn about each sorting algorithm,
Trees Chapter 8.
ITEC200 – Week07 Recursion. 2 Learning Objectives – Week07 Recursion (Ch 07) Students can: Design recursive algorithms to solve.
Fall 2007CS 2251 Trees Chapter 8. Fall 2007CS 2252 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
1 Assignment 2: (Due at 10:30 a.m on Friday of Week 10) Question 1 (Given in Tutorial 5) Question 2 (Given in Tutorial 7) If you do Question 1 only, you.
© 2006 Pearson Addison-Wesley. All rights reserved8 A-1 CMPT 225 Final Review.
Monday, 12/9/02, Slide #1 CS 106 Intro to CS 1 Monday, 12/9/02  QUESTIONS??  On HW #5 (Due 5 pm today)  Today:  Recursive functions  Reading: Chapter.
CS102 – Data Structures Lists, Stacks, Queues, Trees, Hash Collections Framework David Davenport Spring 2002.
Stack: Linked List Implementation Push and pop at the head of the list New nodes should be inserted at the front of the list, so that they become the top.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 – Data Structures Outline 12.1Introduction.
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
Week 7 - Wednesday.  What did we talk about last time?  Recursive running time  Master Theorem  Introduction to trees.
Binary Trees. Node structure Data A data field and two pointers, left and right.
Chapter 12 Data Structure Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
1 Recursion Dr. Bernard Chen Ph.D. University of Central Arkansas.
Stacks and Queues Introduction to Computing Science and Programming I.
CSE 143 Lecture 5 Stacks and Queues slides created by Marty Stepp
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Midterm.
Spring 2010CS 2251 Trees Chapter 6. Spring 2010CS 2252 Chapter Objectives Learn to use a tree to represent a hierarchical organization of information.
Tree (new ADT) Terminology:  A tree is a collection of elements (nodes)  Each node may have 0 or more successors (called children)  How many does a.
CompSci 100e Program Design and Analysis II March 29, 2011 Prof. Rodger CompSci 100e, Spring20111.
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
TREES Lecture 12 CS2110 – Fall Announcements  Prelim #1 is tonight!  Olin 155  A-L  5:30  M-Z  5:30  A4 will be posted today  Mid-semester.
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
Today: Office hours –No tomorrow. M/T- 3-on. Overloading operators Inheritance Review.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 18: Stacks and Queues (part 2)
CS342 Data Structures End-of-semester Review S2002.
CS102 – Data Structures Lists, Stacks, Queues, Trees & HashTables. David Davenport.
+ David Kauchak cs312 Review. + Midterm Will be posted online this afternoon You will have 2 hours to take it watch your time! if you get stuck on a problem,
Week 7 - Friday.  What did we talk about last time?  Trees in general  Binary search trees.
COMP 103 Traversing Trees. 2 RECAP-TODAY RECAP  Building and Traversing Trees TODAY  Traversing Trees  Chapter 16, especially 16.2.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
Week 5 - Wednesday.  What did we talk about last time?  Recursion  Definitions: base case, recursive case  Recursive methods in Java.
April 27, 2017 COSC Data Structures I Review & Final Exam
Trees Ellen Walker CPSC 201 Data Structures Hiram College.
Week 7 - Wednesday.  What did we talk about last time?  Recursive running time  Master Theorem  Symbol tables.
 Saturday, April 20, 8:30-11:00am in B9201  Similar in style to written midterm exam  May include (a little) coding on paper  About 1.5 times as long.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To introduce the basic concepts of linked lists ❏ To introduce the basic concepts.
1 Chapter 8 Recursion. 2 Recursive Function Call a recursion function is a function that either directly or indirectly makes a call to itself. but we.
CS6045: Advanced Algorithms Data Structures. Dynamic Sets Next few lectures will focus on data structures rather than straight algorithms In particular,
UNIT-II Topics to be covered Singly linked list Circular linked list
Week 15 – Monday.  What did we talk about last time?  Tries.
1 i206: Lecture 17: Exam 2 Prep ; Intro to Regular Expressions Marti Hearst Spring 2012.
CSC 172 DATA STRUCTURES. MIDTERM REVIEW MIDTERM EXAM 75 min 6 – 10 questions a lot like the quiz questions.
Final Exam Review CS 3358.
Computing with C# and the .NET Framework
Data Structure By Amee Trivedi.
Week 4 - Friday CS221.
Midterm Review.
Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos
Week 6 - Wednesday CS221.
Mid Term Review Advanced Programming Ananda Gunawardena
Week 15 – Monday CS221.
Stacks and Queues.
Stacks and Queues.
Lesson Objectives Aims
CS6045: Advanced Algorithms
Stacks and Queues 1.
2018, Fall Pusan National University Ki-Joune Li
COMPUTER 2430 Object Oriented Programming and Data Structures I
DS.I.1 CSE 373: Data Structures and Algorithms Autumn Quarter 2000
Stacks and Queues.
Presentation transcript:

Final Exam Preview Chapter 4,5,6,7,8,9

Remember to evaluate CS221  Go to  Ends tonight.  Go to  Ends tonight.

Final Exam Overview  The purpose of these slides is to show you the type of questions and format of questions to be asked on the final exam.  Wednesday, December 12, 2007  8:00 – 9:50 a.m.  Closed Book(s).  You may have one 8-1/2 x 11 inch paper with hand written notes both sides.  The purpose of these slides is to show you the type of questions and format of questions to be asked on the final exam.  Wednesday, December 12, 2007  8:00 – 9:50 a.m.  Closed Book(s).  You may have one 8-1/2 x 11 inch paper with hand written notes both sides.

Evaluate the following:  *  * +  *  * +

Convert the following to postfix  (8 + 2) * (1 – 5)   (8 + 2) * (1 – 5) 

Given this list, what does code do? (Assume nmbr is 3)

Draw the list as it appears after the code runs.

Draw your maze stack.

Answer the following:  What is the advantage of using a linked list for a stack rather than an array?  What is the “run-time stack”?  What is an “activation Frame”?  Show the run-time stack for the running of a recursive program like (sum of integers).  Show a stack used to evaluate whether “race car” is a palindrome?  What is FIFO?  What is LIFO?  Give a practical example of a queue used in a computer operating system.  What is the advantage of using a linked list for a stack rather than an array?  What is the “run-time stack”?  What is an “activation Frame”?  Show the run-time stack for the running of a recursive program like (sum of integers).  Show a stack used to evaluate whether “race car” is a palindrome?  What is FIFO?  What is LIFO?  Give a practical example of a queue used in a computer operating system.

Do the following:  Draw a doubly linked list with four nodes?  List two advantages of being doubly linked.  Convert your doubly linked list into a circularly linked list.  Draw a linked list of binary search trees (each tree to only 3 levels). Show at least three trees.  Prove ??? Using induction.  Draw rough code for a pre-order traversal of a ternary tree.  Draw a doubly linked list with four nodes?  List two advantages of being doubly linked.  Convert your doubly linked list into a circularly linked list.  Draw a linked list of binary search trees (each tree to only 3 levels). Show at least three trees.  Prove ??? Using induction.  Draw rough code for a pre-order traversal of a ternary tree.

Given string “RayBabcock” what prints if code is run? public static void printCharsFunny(String str) { if (str == null || str.equals("")) { return; } else { printCharsFunny(str.substring(1)); System.out.println(str.charAt(0)); }

Write the three traversals.

Prove by Induction  N^2 – n – 1 > 0 for n >= 2

Prove by Induction  N^2 – n – 1 > 0 for n >= 2  Base Case: n = 2  2^2 – 2 – 1 > 0  1 > 0   N^2 – n – 1 > 0 for n >= 2  Base Case: n = 2  2^2 – 2 – 1 > 0  1 > 0 

Prove by Induction  N^2 – n – 1 > 0 for n >= 2  Base Case: n = 2  2^2 – 2 – 1 > 0  1 > 0   Assume true  n <= N. Need to show for N+1.  N^2 – n – 1 > 0 for n >= 2  Base Case: n = 2  2^2 – 2 – 1 > 0  1 > 0   Assume true  n <= N. Need to show for N+1.

Prove by Induction  N^2 – n – 1 > 0 for n >= 2  Base Case: n = 2  2^2 – 2 – 1 > 0  1 > 0   Assume true  n <= N. Need to show for N+1.  (N+1)^2 – (N+1) – 1 = N^2 + 2N + 1 – N – 1 – 1  = N^2 + N – 1  > N^2 – N – 1  > 0 by inductive hypothesis  N^2 – n – 1 > 0 for n >= 2  Base Case: n = 2  2^2 – 2 – 1 > 0  1 > 0   Assume true  n <= N. Need to show for N+1.  (N+1)^2 – (N+1) – 1 = N^2 + 2N + 1 – N – 1 – 1  = N^2 + N – 1  > N^2 – N – 1  > 0 by inductive hypothesis

Is this a Heap?

What Kind of Heap Now?

Do the set operations.

Using hash function given, hash these values into the table.

I reserve 10% as a surprise.  ??