L Please get a complete set (brown, green, red and yellow) of colored paper from the front.

Slides:



Advertisements
Similar presentations
Algorithms (and Datastructures) Lecture 3 MAS 714 part 2 Hartmut Klauck.
Advertisements

CS16: Data Structures & Algorithms | Spring 2014 Midterm Review 3/16/
Graphs CSC 220 Data Structure. Introduction One of the Most versatile data structures like trees. Terminology –Nodes in trees are vertices in graphs.
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Graphs Chapter 20 Data Structures and Problem Solving with C++: Walls and Mirrors, Carrano and Henry, © 2013.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 excerpts Graphs (breadth-first-search)
Advanced Data Structures
CS 206 Introduction to Computer Science II 11 / 11 / Veterans Day Instructor: Michael Eckmann.
Graph & BFS.
CS 206 Introduction to Computer Science II 10 / 31 / 2008 Happy Halloween!!! Instructor: Michael Eckmann.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Graph COMP171 Fall Graph / Slide 2 Graphs * Extremely useful tool in modeling problems * Consist of: n Vertices n Edges D E A C F B Vertex Edge.
Data Structures & Algorithms What The Course Is About s Data structures is concerned with the representation and manipulation of data. s All programs.
Graph & BFS Lecture 22 COMP171 Fall Graph & BFS / Slide 2 Graphs * Extremely useful tool in modeling problems * Consist of: n Vertices n Edges D.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
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 / 03 / 2008 Instructor: Michael Eckmann.
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 03 / 25 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 09 / 2009 Instructor: Michael Eckmann.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
Graphs Chapter 20 Data Structures and Problem Solving with C++: Walls and Mirrors, Frank Carrano, © 2012.
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
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)
Graphs CS 400/600 – Data Structures. Graphs2 Graphs  Used to represent all kinds of problems Networks and routing State diagrams Flow and capacity.
Course notes CS2606: Data Structures and Object-Oriented Development Graphs Department of Computer Science Virginia Tech Spring 2008 (The following notes.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
MA/CSSE 473 Day 12 Insertion Sort quick review DFS, BFS Topological Sort.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Chapter 14 Graphs. © 2004 Pearson Addison-Wesley. All rights reserved Terminology G = {V, E} A graph G consists of two sets –A set V of vertices,
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
Graphs. What is a graph? A data structure that consists of a set of nodes (vertices) and a set of edges that relate the nodes to each other The set of.
MA/CSSE 473 Day 15 BFS Topological Sort Combinatorial Object Generation Intro.
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
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 61B Data Structures and Programming Methodology Aug 4, 2008 David Sun.
Runtime O(VE), for +/- edges, Detects existence of neg. loops
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.
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.
Graphs A graphs is an abstract representation of a set of objects, called vertices or nodes, where some pairs of the objects are connected by links, called.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
COSC 2007 Data Structures II
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
© 2006 Pearson Addison-Wesley. All rights reserved 14 A-1 Chapter 14 Graphs.
Graphs Upon completion you will be able to:
CSE 340: Review (at last!) Measuring The Complexity Complexity is a function of the size of the input O() Ω() Θ() Complexity Analysis “same order” Order.
Graphs + Shortest Paths David Kauchak cs302 Spring 2013.
Graph Representations And Traversals. Graphs Graph : – Set of Vertices (Nodes) – Set of Edges connecting vertices (u, v) : edge connecting Origin: u Destination:
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 GRAPHS – Definitions A graph G = (V, E) consists of –a set of vertices, V, and –a set of edges, E, where each edge is a pair (v,w) s.t. v,w  V Vertices.
Exam 2 Review. Teams David P, Sebastian, Nathan P, Harrison Scott, Josh, Patrick, Peter Michael, Alexia, Betsey, Keith Ty, Casey, Jesi, Lexa Maddie, Nathan.
Graphs Representation, BFS, DFS
Program based on pointers in C.
Ellen Walker CPSC 201 Data Structures Hiram College
Graphs Representation, BFS, DFS
Graphs Chapter 13.
Chapter 14 Graphs © 2006 Pearson Addison-Wesley. All rights reserved.
Sorting.
Chapter 16 1 – Graphs Graph Categories Strong Components
Important Problem Types and Fundamental Data Structures
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
INTRODUCTION A graph G=(V,E) consists of a finite non empty set of vertices V , and a finite set of edges E which connect pairs of vertices .
Presentation transcript:

l Please get a complete set (brown, green, red and yellow) of colored paper from the front.

CS 61BL Final Review Data Structures Colleen Lewis, Kaushik Iyer, Jonathan Kotker, David Zeng, George Wang

Topics of Emphasis (not exhaustive) Java Public Private Pass by Value / Class Encap Overriding Iterator Inheritance Wrapper Exceptions Commenting Testing Recusion / Iteration

Topics of Emphasis (not exhaustive) Data Structures Hash Tables Array / Linked List Destructive / Non-Destructive Graphs List/Matrix Priority Queue / Heap Bottom Up Heap Stack Queues Trees BST AVLTree

Topics of Emphasis (not exhaustive) Sorting / Algorithms Dijkstras Topological Sort Binary Search Bubble Insert Selection Merge Quick

How long does it take to determine if an undirected graph contains a vertex that is connected to no other vertices if you use an adjacency matrix? Option A: V+E Option B: V^2 Option C: VE Option D: V

How long does it take to determine if an undirected graph contains a vertex that is connected to no other vertices if you use an adjacency matrix? Option A: V+E Option B: V^2 Option C: VE Option D: V

How long does it take to determine if an undirected graph contains a vertex that is connected to no other vertices if you use an adjacency LIST? Option A: V+E Option B: V^2 Option C: VE Option D: V

How long does it take to determine if an undirected graph contains a vertex that is connected to no other vertices if you use an adjacency LIST? Option A: V+E Option B: V^2 Option C: VE Option D: V

What is the Topological Sort? Option A: B E A C D Option B: B A E C D Option C: B A C E D Option D: Other

What is the Topological Sort? Option A: B E A C D Option B: B A E C D Option C: B A C E D Option D: Other

What is the Dijkstra’s order it visits nodes, and distances from B? Option A: BADCE Option B: BDACE Option C: BEACD Option D: BACDE

What is the Dijkstra’s order it visits nodes, and distances from B? Option A: BADCE Option B: BDACE Option C: BEACD Option D: BACDE

Apply the Radix sort algorithm on the following list of English words: COW, DOG, SEA, RUG, ROW, MOB, BOX, TAB, BAR, EAR, TAR, DIG, BIG, TEA, NOW, FOX. Show the following in Order Option A: COW, DOG, SEA, RUG, ROW, MOB, BOX, TAB, BAR, EAR, TAR, DIG, BIG, TEA, NOW, FOX Option B: SEA TEA MOB TAB DOG RUG DIG BIG BAR EAR TAR COW ROW NOW BOX FOX Option C: TAB BAR EAR TAR TEA SEA BIG DIG MOB DOG COW ROW NOW BOX FOX RUG Option D: BAR BIG BOX COW DIG DOG EAR FOX MOB NOW ROW RUG SEA TAB TAR TEA

Apply the Radix sort algorithm on the following list of English words: COW, DOG, SEA, RUG, ROW, MOB, BOX, TAB, BAR, EAR, TAR, DIG, BIG, TEA, NOW, FOX. Show the following in Order: ABCD Option A: COW, DOG, SEA, RUG, ROW, MOB, BOX, TAB, BAR, EAR, TAR, DIG, BIG, TEA, NOW, FOX Option B: SEA TEA MOB TAB DOG RUG DIG BIG BAR EAR TAR COW ROW NOW BOX FOX Option C: TAB BAR EAR TAR TEA SEA BIG DIG MOB DOG COW ROW NOW BOX FOX RUG Option D: BAR BIG BOX COW DIG DOG EAR FOX MOB NOW ROW RUG SEA TAB TAR TEA

After a few iterations of some sort, this is what we have so far. Which? Option A: Insertion Sort / Selection Option B: Quick Sort Option C: Merge Sort Option D: Heap Sort

After a few iterations of some sort, this is what we have so far. Which? Option A: Insertion Sort / Selection Option B: Quick Sort Option C: Merge Sort Option D: Heap Sort

After a few iterations of some sort, this is what we have so far. Which? Option A: Insertion Sort / Selection Option B: Quick Sort Option C: Merge Sort Option D: Heap Sort

After a few iterations of some sort, this is what we have so far. Which? Option A: Insertion Sort / Selection Option B: Quick Sort Option C: Merge Sort Option D: Heap Sort

After a few iterations of some sort, this is what we have so far. Which? Option A: Insertion Sort / Selection Option B: Quick Sort Option C: Merge Sort Option D: Heap Sort

After a few iterations of some sort, this is what we have so far. Which? Option A: Insertion Sort / Selection Option B: Quick Sort Option C: Merge Sort Option D: Heap Sort

After a few iterations of some sort, this is what we have so far. Which? Option A: Insertion Sort / Selection Option B: Quick Sort Option C: Merge Sort Option D: Heap Sort

After a few iterations of some sort, this is what we have so far. Which? Option A: Insertion Sort / Selection Option B: Quick Sort Option C: Merge Sort Option D: Heap Sort

An undirected graph contains a "cycle" (i.e., loop) if there are two different simple paths by which we can get from one vertex to another. Using your favorite graph traversal algorithm, how can we tell if an undirected graph contains a cycle?

For the following list of numbers, run the following sorting algorithms: As an example, here’s Selection Sort: Radix Heap Sort Quick Sort (Pick a random pivot) Merge Sort Insertion Sort

Recall that an undirected graph is "connected" if there is a path from any vertex to any other vertex. If an undirected graph is not connected, it has multiple connected components. A connected component" consists of all the vertices reachable from a given vertex, and the edges incident on those vertices. Suggest an algorithm based on DFS (possibly multiple invocations of DFS) that counts the number of connected components in a graph.

Code a ‘contains’ method for a Priority Queue implemented as a MinHeap that requires the fewest number of comparisons possible. We don’t mean asymptotically, we mean the absolute fewest comparisons possible. For sake of simplicity, assume the array-based implementation of minHeap, where the first element occurs at index 1. Assume it is represented as the following: int[] heap = new int[n]; //n is the size of the heap