Welcome to IT 516! Data Structures & Algorithms Review of Linked Lists Parallel ordered arrays Binary Search Trees Tom Becker Summerr 2018 Lecture 7.

Slides:



Advertisements
Similar presentations
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
Advertisements

CSCE 210 Data Structures and Algorithms
1 Advanced Data Structures. 2 Topics Data structures (old) stack, list, array, BST (new) Trees, heaps, union-find, hash tables, spatial, string Algorithm.
Data Structures & Algorithms What The Course Is About s Data structures is concerned with the representation and manipulation of data. s All programs.
Midterm Exam Two Tuesday, November 25 st In class cumulative.
CS 206 Introduction to Computer Science II 04 / 29 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 12 / 10 / 2008 Instructor: Michael Eckmann.
EXAM REVIEW CSC 172 SPRING 2004 LECTURE 26. Want to TA for next semester?
Introduction. 2COMPSCI Computer Science Fundamentals.
Lecture 10: Class Review Dr John Levine Algorithms and Complexity March 13th 2006.
BIT 142:Programming & Data Structures in C#. A2 due date  A2 is due this Friday, June 12 th, by 11:30am BIT 142: Intermediate Programming2.
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
2011-T2 Lecture 21 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, and Peter Andreae, VUW.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Data Structures and Algorithms in Java AlaaEddin 2012.
 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.
BIT 142:Programming & Data Structures in C#. BIT 143  Continues where this leaves off  A couple of weeks to review OOP, object composition, Big “Oh”
بسم الله الرحمن الرحيم شرح جميع طرق الترتيب باللغة العربية
Priority Queues and Heaps Tom Przybylinski. Maps ● We have (key,value) pairs, called entries ● We want to store and find/remove arbitrary entries (random.
Algorithm homework help For More Detail help.aspx - Phone:-
Final Exam Review CS 3358.
CSCE 210 Data Structures and Algorithms
Data Structures and Algorithms
Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 1/28/04
Midterm Review.
MIS 215 Module 1 – Unordered Lists
External Sorting Chapter 13
Programming Abstractions
Data Structures Using C++ 2E
Cse 373 April 24th – Hashing.
October 30th – Priority QUeues
MA/CSSE 473 Day 21 AVL Tree Maximum height 2-3 Trees
Hashing Exercises.
COMP 103 Sorting with Binary Trees: Tree sort, Heap sort Alex Potanin
COMP 103 HeapSort Thomas Kuehne 2013-T1 Lecture 27
Cse 373 April 12th – TreEs.
ECET 370 HELPS Lessons in Excellence- -ecet370helps.com.
CS302 Data Structures Fall 2012.
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
Heaps & Priority Queues
CS 3343: Analysis of Algorithms
original list {67, 33,49, 21, 25, 94} pass { } {67 94}
A Data Structure Bestiary
Ch 6: Heapsort Ming-Te Chi
i206: Lecture 14: Heaps, Graphs intro.
CS 3343: Analysis of Algorithms
ITEC 2620M Introduction to Data Structures
External Sorting Chapter 13
CS 3343: Analysis of Algorithms
8/04/2009 Many thanks to David Sun for some of the included slides!
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
Sorting.
Heap Sort CSE 2011 Winter January 2019.
Priority Queues (Chapter 6.6):
CS 3343: Analysis of Algorithms
Introduction to Data Structures
Dr.Surasak Mungsing CSE 221/ICT221 Analysis and Design of Algorithms Lecture 05-2: Analysis of time Complexity of Priority.
CSE 12 – Basic Data Structures
CSE 373, Copyright S. Tanimoto, 2002 Priority Queues -
Priority Queues (Chapter 6):
Important Problem Types and Fundamental Data Structures
CSCE 3110 Data Structures & Algorithm Analysis
Chapter 12 Heap ADT © 2011 Pearson Addison-Wesley. All rights reserved.
CSCE 3110 Data Structures & Algorithm Analysis
CSCE 3110 Data Structures & Algorithm Analysis
CS203 Lecture 14.
External Sorting Chapter 13
CMPT 225 Lecture 16 – Heap Sort.
Presentation transcript:

Welcome to IT 516! Data Structures & Algorithms Review of Linked Lists Parallel ordered arrays Binary Search Trees Tom Becker Summerr 2018 Lecture 7

IT WeekDateTopics Weekly Assignments 105/23/18Introduction, Quick Find/Union, WQFHW 1,2,3 205/30/18Bags, Stacks, QueuesHW /6/18Algorithm Analysis, Elementary Sorts (Selection, Insertion, Shuffle sorts ) HW 5 406/13/18Merge sort, Quicksort HW 6 506/20/18Priority Queues, Heaps, Heap correctHW 7 606/27/18MT EXAM, Heapsort Symbol Tables, BSTs Searching, HW8 707/11/18BSTs, HashingHW 9 807/18/18 Undirected Graphs, Directed Graphs HW 907/25/18Data CompressionHW 1008/01/18Final ExamHW 11 OVERVIEW OF TOPICS AND SCHEDULE OF TOPICS AND ACTIVITIES

CSC521 Spring 2011 Lecture 1 7 KEYVALUE A A 4.00 A B+3.33 … D1.00 Symbol Table Example – GPA – Create a ST

CSC521 Spring 2011 Lecture 1 8 KEYVALUE A A 4.00 A B+3.33 … D1.00 Symbol Table Example -- GPA Create a ST ST grades = new ST ();

CSC521 Spring 2011 Lecture 1 9 KEYVALUE A A 4.00 A B+3.33 … D1.00 Symbol Table Example -- GPA ST grades = new ST (); grades.put("A+", 4.33); ….What if I wanted to input these pairs from a file??

Lecture 1 10 KEYVALUE A A 4.00 A B+3.33 … D1.00 Symbol Table Example -- GPA String key = StdIn.readString(); st.put(key, i); } for (int i = 0; !StdIn.isEmpty(); i++) {

CSC521 Spring 2011 Lecture 1 11 Symbol Table Exercise

So How can we actually implement Symbol Tables?

OOPs  If match – change value

Everyone remember Binary Search??? So the order of Binary Search is ______??? BUT… what am I forgetting?

This Uses 2 fast parallel arrays !!

KEY array - sorted list of values. To find a value associated with a particular KEY, You need to binary search keys[] array by VALUE, then look in that position in the vals[] array!! Don’t confuse the VALUE with the positions in keys array – the VALUE for X is in the same position in the vals array… We keep the VALUE for a KEY in the same array position as the KEY is in!

WHILE log N for SEARCH is excellent (Binary searching is just very HARD to Beat!!!) the ORDER of inserts is still proportional to N/2 which is just TOO SLOW!

This tree has nodes with information in them…

What’s the difference with nodes in a HEAP??

LETS do some demonstrations on a different tree ….

For the GET operation we would RETURN the KEY and VALUE stored here!!

To INSERT G – Do the SAME Search Steps and – insert it!!

EXAMPLESEARCH Take a sheet of paper and create a BST for this text string:

E A C X M L H P S R EXAMPLE SEARCH … one of many! Binary search Tree For

A C E H R S X Take a sheet of paper and create a BST for this text string:

A C E H R S X Take a sheet of paper and create a BST for this text string: H C S A E R X Now this one:

A C E H R S X Take a sheet of paper and create a BST for this text string: H C S A E R X Now this one: X S R H E C A And Last :

Try this demo: BST Demonstration

What (1) thing was critical for the success of Quicksort?

EXTRA Slides