Data Structure Activities Richard Anderson University of Washington July 2, 20081IUCEE: Data Structures Activities.

Slides:



Advertisements
Similar presentations
Transform and Conquer Chapter 6. Transform and Conquer Solve problem by transforming into: a more convenient instance of the same problem (instance simplification)
Advertisements

AVL Trees CS II – Fall /8/2010. Announcements HW#2 is posted – Uses AVL Trees, so you have to implement an AVL Tree class. Most of the code is provided.
Transform & Conquer Replacing One Problem With Another Saadiq Moolla.
Data Abstraction and Problem Solving with JAVA Walls and Mirrors Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Data Abstraction and Problem.
1 HeapSort CS 3358 Data Structures. 2 Heapsort: Basic Idea Problem: Arrange an array of items into sorted order. 1) Transform the array of items into.
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.
授課教授:李錫智 Data Structures -3 rd exam-. 1.[5] Refer to the two trees in Fig. 1. Let’s define the balance factor BF of a node to be the absolute value of.
1 1 Classroom Presenter 3 Ruth Anderson Dept of Computer Science & Engineering University of Washington Demo.
1 1 Classroom Presenter 3 Richard Anderson Ruth Anderson Dept of Computer Science & Engineering University of Washington Demo.
Data Structures Richard Anderson University of Washington 7/2/20081IUCEE: Data Structures.
More sorting algorithms: Heap sort & Radix sort. Heap Data Structure and Heap Sort (Chapter 7.6)
TCSS 343, version 1.1 Algorithms, Design and Analysis Transform and Conquer Algorithms Presorting HeapSort.
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
Initializing A Max Heap input array = [-, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
CS 206 Introduction to Computer Science II 04 / 29 / 2009 Instructor: Michael Eckmann.
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,
CS 206 Introduction to Computer Science II 12 / 10 / 2008 Instructor: Michael Eckmann.
3-Sorting-Intro-Heapsort1 Sorting Dan Barrish-Flood.
CSE 326: Data Structures Sorting Ben Lerner Summer 2007.
Huffman Coding Draw the tree, label all nodes w/ index, leaves w/ letter and all links(0 or 1) What is the most frequent letter? What is the least frequent.
CSE 326 Huffman coding Richard Anderson. Coding theory Conversion, Encryption, Compression Binary coding Variable length coding A B C D E F.
Cpt S 223 – Advanced Data Structures Course Review Midterm Exam # 2
EXAM REVIEW CSC 172 SPRING 2004 LECTURE 26. Want to TA for next semester?
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue 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)
Lecture Objectives  To learn how to use a Huffman tree to encode characters using fewer bytes than ASCII or Unicode, resulting in smaller files and reduced.
Final Review Dr. Yingwu Zhu. Goals Use appropriate data structures to solve real- world problems –E.g., use stack to implement non-recursive BST traversal,
Lecture 2 Sorting. Sorting Problem Insertion Sort, Merge Sort e.g.,
Outline Priority Queues Binary Heaps Randomized Mergeable Heaps.
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Final.
IS 2610: Data Structures Priority Queue, Heapsort, Searching March 15, 2004.
Final Exam Tuesday, December 22nd 2:00 - 3:50pm room 102 Warren Weaver Hall.
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
Data Structure II. Outline Heap Binary Search Tree Hash Table Binary Indexed Tree Segment Tree.
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.
8 January Heap Sort CSE 2011 Winter Heap Sort Consider a priority queue with n items implemented by means of a heap  the space used is.
Fundamental Data Structures and Algorithms Margaret Reid-Miller 1 March 2005 More LZW / Midterm Review.
Lecture 14 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
CISC220 Fall 2009 James Atlas Dec 07: Final Exam Review.
CSE 3358 NOTE SET 13 Data Structures and Algorithms.
Exam 3 Review Data structures covered: –Hashing and Extensible hashing –Priority queues and binary heaps –Skip lists –B-Tree –Disjoint sets For each of.
Foundation of Computing Systems Lecture 4 Trees: Part I.
 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.
Properties: -The value in each node is greater than all values in the node’s subtrees -Complete tree! (fills up from left to right) Max Heap.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
CSC 2300 Data Structures & Algorithms March 13, 2007 Chapter 6. Priority Queues.
Nov 2, 2001CSE 373, Autumn Hash Table example marking deleted items + choice of table size.
AVL Tree: Balanced Binary Search Tree 9.
Final Exam Review CS 3358.
Lecture 15 AVL Trees Slides modified from © 2010 Goodrich, Tamassia & by Prof. Naveen Garg’s Lectures.
Introduction Applications Balance Factor Rotations Deletion Example
Hashing Exercises.
Dynamic Dictionaries Primary Operations: Additional operations:
Lecture 5 HeapSort Priority queue and Heapsort
Review for Final Exam Non-cumulative, covers material since exam 2
CSE 326: Data Structures: Midterm Review
Data Structures & Algorithms
Tips on Homework 2 Fei Chen.
Sorting.
Heap Sort CSE 2011 Winter January 2019.
CSE 326 Huffman coding Richard Anderson.
Final Review Dr. Yingwu Zhu.
EE 312 Final Exam Review.
AVL Trees B.Ramamurthy 4/27/2019 BR.
Priority Queues Supports the following operations. Insert element x.
Chapter 12 Heap ADT © 2011 Pearson Addison-Wesley. All rights reserved.
A Heap Is Efficiently Represented As An Array
EE 312 Software Design and Implementation I
Presentation transcript:

Data Structure Activities Richard Anderson University of Washington July 2, 20081IUCEE: Data Structures Activities

Decode the following E0 T11 N100 I1010 S E0 T10 N100 I0111 S July 2, 20082IUCEE: Data Structures Activities

Construct the tree for the following code E0 T11 N100 I1010 S1011 July 2, 20083IUCEE: Data Structures Activities

Draw a Huffman tree for the following data values and show internal weights: 3, 5, 9, 14, 16, 35 July 2, 20084IUCEE: Data Structures Activities

5 Delete 10 – replace w. smallest in right subtree Student Activity July 2, 2008IUCEE: Data Structures Activities

July 2, 2008IUCEE: Data Structures Activities6 AVL Trees What is the most important aspect of AVL trees?

July 2, 2008IUCEE: Data Structures Activities7 ZIG-ZAG X Y Z Show the ZIG-ZAG transformation to bring X to the root A B C D

July 2, 2008IUCEE: Data Structures Activities8 Splay E (submit your answer) B I H C D G F E A

July 2, 2008IUCEE: Data Structures Activities9 Splay Trees What is the most important aspect of Splay trees?

July 2, 2008IUCEE: Data Structures Activities10 Draw an in-tree representation of the following equivalence relation {1,11}, {2, 4, 6, 8, 10, 12}, {3, 5, 7, 9}, {13}, {14}, {15}

Up Student Activity int Find(x:int) } Give the code for the find operation July 2, 2008IUCEE: Data Structures Activities

July 2, 2008IUCEE: Data Structures Activities12 Binomial Trees Draw B 4 What is the height of B k ? What is the weight of B k ?

Comparing Priority Queues Binary Heaps d-Heaps Leftist Heaps Skew Heaps Binomial Queues: Student Activity July 2, 2008IUCEE: Data Structures Activities

14 Resolving Collisions with Double Hashing Insert these values into the hash table in this order. Resolve any collisions with double hashing: Hash Functions: H(K) = K mod M H 2 (K) = 1 + ((K/M) mod (M-1)) M = 10 Student Activity July 2, 2008IUCEE: Data Structures Activities

15 Sort Properties Are the following:stable? in-place? Insertion Sort? Selection Sort? MergeSort? QuickSort? Radix Sort Student Activity July 2, 2008IUCEE: Data Structures Activities

16 RadixSort Input:126, 328, 636, 341, 416, 131, BucketSort on lsd: BucketSort on next-higher digit: BucketSort on msd: Student Activity July 2, 2008IUCEE: Data Structures Activities