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,

Slides:



Advertisements
Similar presentations
Lecture 15. Graph Algorithms
Advertisements

Chapter 23 Minimum Spanning Tree
CHAPTER 7 Greedy Algorithms.
Greed is good. (Some of the time)
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
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.
CS 311 Graph Algorithms. Definitions A Graph G = (V, E) where V is a set of vertices and E is a set of edges, An edge is a pair (u,v) where u,v  V. If.
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.
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.
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.
Chapter 9: Graphs Spanning Trees Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Important Problem Types and Fundamental Data Structures
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
CS112A1 Spring 2008 Practice Final. ASYMPTOTIC NOTATION: a)Show that log(n) and ln(n) are the same in terms of Big-Theta notation b)Show that log(n+1)
1 Hash Tables  a hash table is an array of size Tsize  has index positions 0.. Tsize-1  two types of hash tables  open hash table  array element type.
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.
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
335 Review Game 1. Teams Zack, Jamie, Alex D, Marshall Colby, Riley, Alex Z, Fritz Lawrence, Paul, Gavan, Ben Catharine, Matt, Andrew, Alexis Spencer,
CSC 335 Review Game Exam 2. Teams Andrew, Marshall, Riley, Z Emily, Paul, Dawn, Lisa Gavan, Catharine, David, Alex D Michelle, Matt, Rohan, Jamie Ben,
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
Minimum Spanning Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
CS 146: Data Structures and Algorithms July 23 Class Meeting
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.
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
ITEC 2620A Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: 2620a.htm Office: TEL 3049.
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.
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.
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.
Graphs Upon completion you will be able to:
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
1 the BSTree class  BSTreeNode has same structure as binary tree nodes  elements stored in a BSTree are a key- value pair  must be a class (or a struct)
Graph Searching CSIT 402 Data Structures II. 2 Graph Searching Methodology Depth-First Search (DFS) Depth-First Search (DFS) ›Searches down one path as.
Main Index Contents 11 Main Index Contents Graph Categories Graph Categories Example of Digraph Example of Digraph Connectedness of Digraph Connectedness.
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.
Exam 2 Review. Teams David P, Sebastian, Nathan P, Harrison Scott, Josh, Patrick, Peter Michael, Alexia, Betsey, Keith Ty, Casey, Jesi, Lexa Maddie, Nathan.
Chapter 5 : Trees.
Review for Final Exam Non-cumulative, covers material since exam 2
UCS 406 – Data Structures & Algorithms
Graphs & Graph Algorithms 2
CSE 373 Data Structures and Algorithms
Shortest Path Algorithms
ITEC 2620M Introduction to Data Structures
CSC 380: Design and Analysis of Algorithms
CSE 417: Algorithms and Computational Complexity
Important Problem Types and Fundamental Data Structures
Lecture 14 Minimum Spanning Tree (cont’d)
Priority Queues Binary Heaps
Minimum-Cost Spanning Tree
Presentation transcript:

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, Lisa Marshall, Lawrence, Dan B, Colby, Michelle Zack, Ben, Jerry, Alex Z, Matt

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 slots and only 10 keys. What is its load factor?

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

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

6. What data structure is implemented using a heap?

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

8. What is the main operation supported by a BST?

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 a graph is connected?

17. A connected, acyclic graph is called …

18. The two algorithms that compute MSTs are

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 makes an algorithm “greedy”? Give an example.

25. What is the running time of Kruskal’s?

26. What properties of a graph are necessary for running Prim’s algorithm?

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 are the 2 types of hash tables?

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

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 both Kruskal’s and Prim’s to calculate MSTs. Use alphabetical order for Prim’s. A A E E F F B B G G C C H H D D

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

Design an algorithm that takes as input a connected, undirected graph and computes whether or not there exists an edge in the graph that can be removed and still leave the graph connected. Tell the running time of your algorithm. Feel free to call any algorithm we’ve discussed (you don’t have to re-write the algorithm). boolean REMOVE-BUT-CONNECTED(G)

Write 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 an algorithm that computes the number of nodes in a BST. left(N) gives the left node of N and right(N) gives the right. int SIZE(BST N):