Exam 2 Review. Teams David P, Sebastian, Nathan P, Harrison Scott, Josh, Patrick, Peter Michael, Alexia, Betsey, Keith Ty, Casey, Jesi, Lexa Maddie, Nathan.

Slides:



Advertisements
Similar presentations
Chapter 23 Minimum Spanning Tree
Advertisements

Chapter 12 Binary Search Trees
Transform and Conquer Chapter 6. Transform and Conquer Solve problem by transforming into: a more convenient instance of the same problem (instance simplification)
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Chapter 8, Part I Graph Algorithms.
Advanced Data Structures
ITEC200 – Week 12 Graphs. 2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study.
Midterm 2 Overview Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Priority Queues. Container of elements where each element has an associated key A key is an attribute that can identify rank or weight of an element Examples.
Chapter 9 Graph algorithms. Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Data Structures Heaps and Graphs i206 Fall 2010 John Chuang Some slides adapted from Marti Hearst, Brian Hayes, or Glenn Brookshear.
More sorting algorithms: Heap sort & Radix sort. Heap Data Structure and Heap Sort (Chapter 7.6)
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Chapter 6: Priority Queues Priority Queues Binary Heaps Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
CS 206 Introduction to Computer Science II 11 / 12 / 2008 Instructor: Michael Eckmann.
Graphs & Graph Algorithms 2 Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Graphs & Graph Algorithms 2
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Unit 11a 1 Unit 11: Data Structures & Complexity H We discuss in this unit Graphs and trees Binary search trees Hashing functions Recursive sorting: quicksort,
COMP 171 Data Structures and Algorithms Tutorial 10 Hash Tables.
CS 206 Introduction to Computer Science II 11 / 12 / 2008 Instructor: Michael Eckmann.
Transforming Infix to Postfix
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
Graphs & Graph Algorithms 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Review of Graphs A graph is composed of edges E and vertices V that link the nodes together. A graph G is often denoted G=(V,E) where V is the set of vertices.
Important Problem Types and Fundamental Data Structures
Exam 2 Review. Teams Dan C, Z, Hugh, Zane, Alexis Mark, Jamie, Ryan, Alex H, Andrew Katie, Emily, Riley, Rohan, Alex D Dawn, Patrick, Jacapo, Catharine,
Review – Part 1 CSE 2011 Winter September 2015.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
1 Chapter 9 Graph Algorithms Real-life graph problems Algorithms for some graph problems Choice of data structures for graph problems.
MA/CSSE 473 Day 12 Insertion Sort quick review DFS, BFS Topological Sort.
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
Minimum Spanning Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Chapter 21 Binary Heap.
Common final examinations When: Wednesday, 12/11, 3:30-5:30 PM Where: Ritter Hall - Walk Auditorium 131 CIS 1166 final When: Wednesday, 12/11, 5:45-7:45.
L Please get a complete set (brown, green, red and yellow) of colored paper from the front.
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
Preview  Graph  Tree Binary Tree Binary Search Tree Binary Search Tree Property Binary Search Tree functions  In-order walk  Pre-order walk  Post-order.
Lecture 11 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
CS 206 Introduction to Computer Science II 11 / 16 / 2009 Instructor: Michael Eckmann.
CSC 331 Review Game 1. Teams Katie, Mark, Alex Z, Dan B., Zane Dan C, Alex D, Dawn, Marshall, Zack Colby, Benjamin, Lisa, Riley, Andrew Catharine, Ryan,
1 Chapter 22 Elementary Graph Algorithms. 2 Introduction G=(V, E) –V = vertex set –E = edge set Graph representation –Adjacency list –Adjacency matrix.
Runtime O(VE), for +/- edges, Detects existence of neg. loops
Review for Final Exam – cs411/511 Definitions (5 questions, 2 points each) Algorithm Analysis (3 questions, 3 points each) General Questions (3 questions,
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
Review for Final Exam Non-cumulative, covers material since exam 2 Data structures covered: –Treaps –Hashing –Disjoint sets –Graphs For each of these data.
CS 61B Data Structures and Programming Methodology Aug 5, 2008 David Sun.
CSS446 Spring 2014 Nan Wang.  to study trees and binary trees  to understand how binary search trees can implement sets  to learn how red-black trees.
Week 10 - Friday.  What did we talk about last time?  Graph representations  Adjacency matrix  Adjacency lists  Depth first search.
Graphs. Graphs Similar to the graphs you’ve known since the 5 th grade: line graphs, bar graphs, etc., but more general. Those mathematical graphs are.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
1 C++ Classes and Data Structures Jeffrey S. Childs Chapter 15 Other Data Structures Jeffrey S. Childs Clarion University of PA © 2008, Prentice Hall.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Week 15 – Wednesday.  What did we talk about last time?  Review up to Exam 1.
1Computer Sciences. 2 HEAP SORT TUTORIAL 4 Objective O(n lg n) worst case like merge sort. Sorts in place like insertion sort. A heap can be stored as.
Week 15 – Friday.  What did we talk about last time?  Student questions  Review up to Exam 2  Recursion  Binary trees  Heaps  Tries  B-trees.
1.[10] Suppose we have 14 integers: 10, 100, 30, 130, 80, 50, 140, 20, 60, 70, 120, 40, 90, 110. Please create a 2-3 tree by inserting one integer at a.
Lecture 20. Graphs and network models 1. Recap Binary search tree is a special binary tree which is designed to make the search of elements or keys in.
Chapter 22 Elementary Graph Algorithms
Week 11 - Friday CS221.
Review for Final Exam Non-cumulative, covers material since exam 2
Review for Final Exam Non-cumulative, covers material since exam 2
Review for Final Exam Non-cumulative, covers material since exam 2
original list {67, 33,49, 21, 25, 94} pass { } {67 94}
كلية المجتمع الخرج البرمجة - المستوى الثاني
CSC 380: Design and Analysis of Algorithms
Important Problem Types and Fundamental Data Structures
Presentation transcript:

Exam 2 Review

Teams David P, Sebastian, Nathan P, Harrison Scott, Josh, Patrick, Peter Michael, Alexia, Betsey, Keith Ty, Casey, Jesi, Lexa Maddie, Nathan Y, Jen, Andrew Tanner, Sean, Ben, Eric, John, Zach, Alex M, Jake Elena, Brandon, Haris, David H

1. Suppose a heap has 6 nodes. What is the height of the heap? (Remember the root is at height 0).

2. Suppose you have a binary search tree with 6 nodes. What is the range of what the height of the tree may be?

3. Suppose that a hash table has 50 keys and only 10 slots. What type of hash table must it be?

4. Give one pro of an array over a linked list and vice versa.

5. When would you prefer to use a binary search tree rather than a heap?

6. What data structure is implemented using a heap?

7. What is the main operation supported by a heap?

8. What sort is best on small data sets?

9. Could this be a heap? Why or why not?

10. I’m going to empty a binary search tree by successively finding the smallest element, printing it, and then deleting it until the tree is empty. What’s the best case running time?

11. What are the two schemes for storing edges?

12. What is the running time of depth-first search?

13. When would I prefer to use breadth-first rather than depth-first search?

14. Dijkstra’s algorithm is O((V+E)(lgV)). Where does the lgV term come from?

15. How do you perform a topological sort?

16. How can you tell if an undirected graph is connected?

17. A connected, acyclic graph is called …

18. What is the running time of Count sort?

19. When is Dijkstra’s not used for computing shortest paths?

20. What does “linear probing” refer to?

21. Consider the adjacency matrix: Is the graph directed? Weighted? Dense or sparse?

22. When would you prefer to use an adjacency list rather than an adjacency matrix?

23. What properties of a graph are necessary for a topological sort?

24. What does it mean for a sort to be stable?

25. What does it mean for a sort to be in-place?

26. What is the worst case running time for Quicksort and when does it happen?

27. What operations should be supported by a hash table?

28. What is the running time for inserting or deleting from a hash table if there is a good hash function?

29. What is the best case running time for bubble sort? When does it happen?

30. When would you prefer to use a chaining table rather than an open-address table?

31. Which sort has its best case when it is in reverse order?

32. What algorithm do I use? I’m trying to quickly sort 2 million 10-digit numbers. I have plenty of space but want to save time.

All-Play Run Depth-First on the following graph and classify each edge: B B E E G G H H C C F F D D A A

All-Play Use Dijkstra’s to compute shortest paths from A. A A E E F F B B G G C C H H D D

Explore tells if an undirected graph is connected. Create and analyze an algorithm to tell if a directed graph is connected. boolean IS-CONNECTED(G):

Write and analyze an algorithm that decreases the value of an element in a heap. Use known heap functions. What is the running time? DECREASE_KEY(Heap H, KeyIndex K, Integer Amt):

Write and analyze an algorithm that computes the height of a BST rooted at N left(N) gives the left node of N and right(N) gives the right. int HEIGHT(BST N):