5 AVL trees: deletion

Size: px
Start display at page:

Download "5 AVL trees: deletion"

Transcription

1 5 AVL trees: deletion

2 Definition of AVL trees Definition: A binary search tree is called AVL tree or height-balanced tree, if for each node v the height of the right subtree h(t r ) of v and the height of the left subtree h(t l ) of v differ by at most 1. Balance factor: Theory 1 - AVL trees: deletion 2

3 Deletion from an AVL tree We roceed similarly to standard search trees: 1. search for the key to be deleted. 2. if the key is not contained, we are done. 3. otherwise we distinguish three cases: (a) the node to be deleted has no internal nodes as its children. (b) the node to be deleted has exactly one internal child node. (c) the node to be deleted has two internal children. After deleting a node the AVL roerty may be violated (similar to insertion). This must be fixed aroriately Theory 1 - AVL trees: deletion 3

4 Examle Theory 1 - AVL trees: deletion 4

5 Node has only leaves at children Done! Call uout()! Call uout()! height {1, 2} Theory 1 - AVL trees: deletion 5

6 Node has only leaves at children Case1: height = 1, bal() = Done! Theory 1 - AVL trees: deletion 6

7 Node has only leaves at children Case 2.1: height = 2, bal() = 1, height(tl) =1, height(tr) =1 Left rotation tr tl tr tl done! Theory 1 - AVL trees: deletion 7

8 Node has only leaves at children Case 2.2: height = 2, bal() = 1, height(tl) =, height(tr) =1 Left rotation bal() = tl tr tl tr Call uout()! Case 2.3: height = 2, bal() = 1, height(tl) =1, height(tr) = w x Right-left rotation w y x y tr Call uout()! tl Theory 1 - AVL trees: deletion 8

9 Node has one internal node as a child Call uout! Theory 1 - AVL trees: deletion 9

10 Node has two internal nodes as children First we roceed just like we do in standard search trees: 1. Relace the content of the node to be deleted by the content of its symmetrical successor q. 2. Then delete node q. Since q can have at most one internal node as a child (the right one), cases 1 and 2 aly for q Theory 1 - AVL trees: deletion 1

11 The method uout The method uout works similarly to uin. It is called recursively along the search ath and adjusts the balance factors via rotations and double rotations. When uout is called for a node, we have (see above): 1. bal() = 2. The height of the subtree rooted in has decreased by 1. uout will be called recursively as long as these conditions are fulfilled (invariant). Again, we distinguish 2 cases, deending on whether Is the left or the right child of its arent φ. Since the two cases are symmetrical, we only consider the case where is the left child of φ Theory 1 - AVL trees: deletion 11

12 Examle Theory 1 - AVL trees: deletion 12

13 Case 1.1: is the left child of φ and bal(φ)= -1 φ -1 φ uout(φ) uout() Since the height of the subtree rooted in has decreased by 1, the balance factor of φ changes to. By this, the height of the subtree rooted in φ has also decreased by 1 and we have to call uout(φ) (the invariant now holds for φ!) Theory 1 - AVL trees: deletion 13

14 Case 1.2: is the left child of φ and bal(φ)= φ φ 1 uout() done! Since the height of the subtree rooted in has decreased by 1, the balance factor of φ changes to 1. Then we are done, because the height of the subtree rooted in φ has not changed Theory 1 - AVL trees: deletion 14

15 Case 1.3: is the left child of φ and bal(φ)= +1 φ 1 uout() q Then the right subtree of φ was higher (by 1) than the left subtree before the deletion. Hence, in the subtree rooted in φ the AVL roerty is now violated. We distinguish three cases according to the balance factor of q Theory 1 - AVL trees: deletion 15

16 Case 1.3.1: bal(q) = φ +1 v w -1 u q w v +1 left rotation done! u 1 h 1 h 1 2 h h + 1 h h 1 2 h +1 3 h Theory 1 - AVL trees: deletion 16

17 Case 1.3.2: bal(q) = +1 φ +1 v r w uout(r) uout() u q w 1 v left rotation u 1 h 1 h 1 2 h 3 h + 1 h h 1 2 h 3 h + 1 Again, the height of the subtree has decreased by 1, while bal(r) = (invariant). Hence we call uout(r) Theory 1 - AVL trees: deletion 17

18 Case 1.3.3: bal(q) = -1 φ v +1 r z uout(r) uout() u q w -1 double rotation right-left v w z 1 u h 1 h h h - 1 h 1 h Since bal(q) = -1, one of the trees 2 or 3 must have height h. Therefore, the height of the comlete subtree has decreased by 1, while bal(r) = (invariant). Hence, we again call uout(r) Theory 1 - AVL trees: deletion 18

19 Observation Unlike insertions, deletions may cause recursive calls of uout after a double rotation. Therefore, in general a single rotation or double rotation is not sufficient to rebalance the tree. There are examles where for all nodes along the search ath rotations or double rotations must be carried out. Since h log 2 (n) + 1, we may conclude that the deletion of a key form an AVL tree with n keys can be carried out in at most O(log n) stes. AVL trees are a worst-case efficient data structure for finding, inserting and deleting keys Theory 1 - AVL trees: deletion 19

Binary Search Tree (Part 2 The AVL-tree)

Binary Search Tree (Part 2 The AVL-tree) Yufei Tao ITEE University of Queensland We ave already learned a static version of te BST. In tis lecture, we will make te structure dynamic, namely, allowing it to support updates (i.e., insertions and

More information

CSE 100: RED-BLACK TREES

CSE 100: RED-BLACK TREES 1 CSE 100: RED-BLACK TREES 2 Red-Black Trees 1 70 10 20 60 8 6 80 90 40 1. Nodes are either red or black 2. Root is always black 3. If a node is red, all it s children must be black 4. For every node X,

More information

RBT Operations. The basic algorithm for inserting a node into an RBT is:

RBT Operations. The basic algorithm for inserting a node into an RBT is: RBT Operations The basic algorithm for inserting a node into an RBT is: 1: procedure RBT INSERT(T, x) 2: BST insert(t, x) : colour[x] red 4: if parent[x] = red then 5: RBT insert fixup(t, x) 6: end if

More information

CSS 343 Data Structures, Algorithms, and Discrete Math II. Balanced Search Trees. Yusuf Pisan

CSS 343 Data Structures, Algorithms, and Discrete Math II. Balanced Search Trees. Yusuf Pisan CSS 343 Data Structures, Algorithms, and Discrete Math II Balanced Search Trees Yusuf Pisan Height Height of a tree impacts how long it takes to find an item Balanced tree O(log n) vs Degenerate tree O(n)

More information

mywbut.com Two agent games : alpha beta pruning

mywbut.com Two agent games : alpha beta pruning Two agent games : alpha beta pruning 1 3.5 Alpha-Beta Pruning ALPHA-BETA pruning is a method that reduces the number of nodes explored in Minimax strategy. It reduces the time required for the search and

More information

Topic 23 Red Black Trees

Topic 23 Red Black Trees Topic 23 "People in every direction No words exchanged No time to exchange And all the little ants are marching Red and Black antennas waving" -Ants Marching, Dave Matthew's Band "Welcome to L.A.'s Automated

More information

Self-Adjusting Binary Search Trees. Andrei Pârvu

Self-Adjusting Binary Search Trees. Andrei Pârvu Self-Adjusting Binary Search Trees Andrei Pârvu Andrei Pârvu 13-05-2015 1 Motivation Andrei Pârvu 13-05-2015 2 Motivation: Find Andrei Pârvu 13-05-2015 3 Motivation: Insert Andrei Pârvu 13-05-2015 4 Motivation:

More information

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 17: Heaps and Priority Queues

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 17: Heaps and Priority Queues CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims Lecture 17: Heaps and Priority Queues Stacks and Queues as Lists Stack (LIFO) implemented as list insert (i.e.

More information

Splay tree concept Splaying operation: double-rotations Splay insertion Splay search Splay deletion Running time of splay tree operations

Splay tree concept Splaying operation: double-rotations Splay insertion Splay search Splay deletion Running time of splay tree operations 4.5 Splay trees Splay tree concept Splaying operation: double-rotations Splay insertion Splay search Splay deletion Running time of splay tree operations 43 Splay trees splay tree is a balanced ST built

More information

MITOCW 6. AVL Trees, AVL Sort

MITOCW 6. AVL Trees, AVL Sort MITOCW 6. AVL Trees, AVL Sort The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free.

More information

and 6.855J. Network Simplex Animations

and 6.855J. Network Simplex Animations .8 and 6.8J Network Simplex Animations Calculating A Spanning Tree Flow -6 7 6 - A tree with supplies and demands. (Assume that all other arcs have a flow of ) What is the flow in arc (,)? Calculating

More information

Balanced Trees. Balanced Trees Tree. 2-3 Tree. 2 Node. Binary search trees are not guaranteed to be balanced given random inserts and deletes

Balanced Trees. Balanced Trees Tree. 2-3 Tree. 2 Node. Binary search trees are not guaranteed to be balanced given random inserts and deletes Balanced Trees Balanced Trees 23 Tree Binary search trees are not guaranteed to be balanced given random inserts and deletes! Tree could degrade to O(n) operations Balanced search trees! Operations maintain

More information

Binary trees. Application: AVL trees and the golden ratio. The golden ratio. φ 1=1/φ 1. φ =1+

Binary trees. Application: AVL trees and the golden ratio. The golden ratio. φ 1=1/φ 1. φ =1+ Application: AVL trees and the golden ratio AVL trees are used for storing information in an efficient manner. We will see exactly how in the data structures course. This slide set takes a look at how

More information

CS : Data Structures

CS : Data Structures CS 600.226: Data Structures Micael Scatz Nov 4, 2016 Lecture 27: Treaps ttps:www.nsf.govcrssprgmreureu_searc.jsp Assignment 8: Due Tursday Nov 10 @ 10pm Remember: javac Xlint:all & cecstyle *.java & JUnit

More information

MITOCW ocw lec11

MITOCW ocw lec11 MITOCW ocw-6.046-lec11 Here 2. Good morning. Today we're going to talk about augmenting data structures. That one is 23 and that is 23. And I look here. For this one, And this is a -- Normally, rather

More information

PRIORITY QUEUES AND HEAPS. Slides of Ken Birman, Cornell University

PRIORITY QUEUES AND HEAPS. Slides of Ken Birman, Cornell University PRIORITY QUEUES AND HEAPS Slides of Ken Birman, Cornell University The Bag Interface 2 A Bag: interface Bag { void insert(e obj); E extract(); //extract some element boolean isempty(); } Examples: Stack,

More information

Skip Lists S 3 S 2 S 1. 2/6/2016 7:04 AM Skip Lists 1

Skip Lists S 3 S 2 S 1. 2/6/2016 7:04 AM Skip Lists 1 Skip Lists S 3 15 15 23 10 15 23 36 2/6/2016 7:04 AM Skip Lists 1 Outline and Reading What is a skip list Operations Search Insertion Deletion Implementation Analysis Space usage Search and update times

More information

PRIORITY QUEUES AND HEAPS. Lecture 19 CS2110 Spring 2014

PRIORITY QUEUES AND HEAPS. Lecture 19 CS2110 Spring 2014 1 PRIORITY QUEUES AND HEAPS Lecture 19 CS2110 Spring 2014 Readings and Homework 2 Read Chapter 2 to learn about heaps Salespeople often make matrices that show all the great features of their product that

More information

PRIORITY QUEUES AND HEAPS

PRIORITY QUEUES AND HEAPS PRIORITY QUEUES AND HEAPS Lecture 1 CS2110 Fall 2014 Reminder: A4 Collision Detection 2 Due tonight by midnight Readings and Homework 3 Read Chapter 2 A Heap Implementation to learn about heaps Exercise:

More information

The tenure game. The tenure game. Winning strategies for the tenure game. Winning condition for the tenure game

The tenure game. The tenure game. Winning strategies for the tenure game. Winning condition for the tenure game The tenure game The tenure game is played by two players Alice and Bob. Initially, finitely many tokens are placed at positions that are nonzero natural numbers. Then Alice and Bob alternate in their moves

More information

Generalized Game Trees

Generalized Game Trees Generalized Game Trees Richard E. Korf Computer Science Department University of California, Los Angeles Los Angeles, Ca. 90024 Abstract We consider two generalizations of the standard two-player game

More information

CSI33 Data Structures

CSI33 Data Structures Department of Mathematics and Computer Science Bronx Community College Outline Chapter 7: Trees 1 Chapter 7: Trees Uses Of Trees Chapter 7: Trees Taxonomies animal vertebrate invertebrate fish mammal reptile

More information

COMP 2804 solutions Assignment 4

COMP 2804 solutions Assignment 4 COMP 804 solutions Assignment 4 Question 1: On the first page of your assignment, write your name and student number. Solution: Name: Lionel Messi Student number: 10 Question : Let n be an integer and

More information

Random Binary Search Trees. EECS 214, Fall 2017

Random Binary Search Trees. EECS 214, Fall 2017 Random Binary Search Trees EECS 214, Fall 2017 2 The necessity of balance 7 0 3 11 1 1 5 9 13 2 0 2 4 6 8 10 12 14 14 3 The necessity of balance n lg n 10 4 100 7 1,000 10 10,000 14 100,000 17 1,000,000

More information

Introduction to. Algorithms. Lecture 10. Prof. Constantinos Daskalakis CLRS

Introduction to. Algorithms. Lecture 10. Prof. Constantinos Daskalakis CLRS 6.006- Introduction to Algorithms Lecture 10 Prof. Constantinos Daskalakis CLRS 8.1-8.4 Menu Show that Θ(n lg n) is the best possible running time for a sorting algorithm. Design an algorithm that sorts

More information

1 Permutations. Example 1. Lecture #2 Sept 26, Chris Piech CS 109 Combinatorics

1 Permutations. Example 1. Lecture #2 Sept 26, Chris Piech CS 109 Combinatorics Chris Piech CS 09 Combinatorics Lecture # Sept 6, 08 Based on a handout by Mehran Sahami As we mentioned last class, the principles of counting are core to probability. Counting is like the foundation

More information

Problem A. Worst Locations

Problem A. Worst Locations Problem A Worst Locations Two pandas A and B like each other. They have been placed in a bamboo jungle (which can be seen as a perfect binary tree graph of 2 N -1 vertices and 2 N -2 edges whose leaves

More information

Chapter 7: Sorting 7.1. Original

Chapter 7: Sorting 7.1. Original Chapter 7: Sorting 7.1 Original 3 1 4 1 5 9 2 6 5 after P=2 1 3 4 1 5 9 2 6 5 after P=3 1 3 4 1 5 9 2 6 5 after P=4 1 1 3 4 5 9 2 6 5 after P=5 1 1 3 4 5 9 2 6 5 after P=6 1 1 3 4 5 9 2 6 5 after P=7 1

More information

Solutions to Assignment-2 MOOC-Information Theory

Solutions to Assignment-2 MOOC-Information Theory Solutions to Assignment-2 MOOC-Information Theory 1. Which of the following is a prefix-free code? a) 01, 10, 101, 00, 11 b) 0, 11, 01 c) 01, 10, 11, 00 Solution:- The codewords of (a) are not prefix-free

More information

CS188 Spring 2010 Section 3: Game Trees

CS188 Spring 2010 Section 3: Game Trees CS188 Spring 2010 Section 3: Game Trees 1 Warm-Up: Column-Row You have a 3x3 matrix of values like the one below. In a somewhat boring game, player A first selects a row, and then player B selects a column.

More information

DATA STRUCTURE TREES UNIT II

DATA STRUCTURE TREES UNIT II DATA STRUCTURE TREES UNIT II U2. 1 Trees General Tree Binary trees AVL Trees Binary Tree Applications Threaded Tree B Trees B* Trees B+ Trees Learning Objectives U2. 2 TREE An Hierarchical Collection of

More information

Computational Complexity of Generalized Push Fight

Computational Complexity of Generalized Push Fight Comutational Comlexity of Generalized Push Fight Jeffrey Bosboom Erik D. Demaine Mikhail Rudoy Abstract We analyze the comutational comlexity of otimally laying the two-layer board game Push Fight, generalized

More information

Game Theory and Randomized Algorithms

Game Theory and Randomized Algorithms Game Theory and Randomized Algorithms Guy Aridor Game theory is a set of tools that allow us to understand how decisionmakers interact with each other. It has practical applications in economics, international

More information

CSE 100: BST AVERAGE CASE AND HUFFMAN CODES

CSE 100: BST AVERAGE CASE AND HUFFMAN CODES CSE 100: BST AVERAGE CASE AND HUFFMAN CODES Recap: Average Case Analysis of successful find in a BST N nodes Expected total depth of all BSTs with N nodes Recap: Probability of having i nodes in the left

More information

CSE 573 Problem Set 1. Answers on 10/17/08

CSE 573 Problem Set 1. Answers on 10/17/08 CSE 573 Problem Set. Answers on 0/7/08 Please work on this problem set individually. (Subsequent problem sets may allow group discussion. If any problem doesn t contain enough information for you to answer

More information

Lecture5: Lossless Compression Techniques

Lecture5: Lossless Compression Techniques Fixed to fixed mapping: we encoded source symbols of fixed length into fixed length code sequences Fixed to variable mapping: we encoded source symbols of fixed length into variable length code sequences

More information

Is 1 a Square Modulo p? Is 2?

Is 1 a Square Modulo p? Is 2? Chater 21 Is 1 a Square Modulo? Is 2? In the revious chater we took various rimes and looked at the a s that were quadratic residues and the a s that were nonresidues. For examle, we made a table of squares

More information

ARTIFICIAL INTELLIGENCE (CS 370D)

ARTIFICIAL INTELLIGENCE (CS 370D) Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) (CHAPTER-5) ADVERSARIAL SEARCH ADVERSARIAL SEARCH Optimal decisions Min algorithm α-β pruning Imperfect,

More information

Some results on Su Doku

Some results on Su Doku Some results on Su Doku Sourendu Gupta March 2, 2006 1 Proofs of widely known facts Definition 1. A Su Doku grid contains M M cells laid out in a square with M cells to each side. Definition 2. For every

More information

Stack permutations and an order relation for binary trees

Stack permutations and an order relation for binary trees University of Wollongong Research Online Department of Computing Science Working Paper Series Faculty of Engineering and Information Sciences 1982 Stack permutations and an order relation for binary trees

More information

CS188 Spring 2010 Section 3: Game Trees

CS188 Spring 2010 Section 3: Game Trees CS188 Spring 2010 Section 3: Game Trees 1 Warm-Up: Column-Row You have a 3x3 matrix of values like the one below. In a somewhat boring game, player A first selects a row, and then player B selects a column.

More information

1 Permutations. 1.1 Example 1. Lisa Yan CS 109 Combinatorics. Lecture Notes #2 June 27, 2018

1 Permutations. 1.1 Example 1. Lisa Yan CS 109 Combinatorics. Lecture Notes #2 June 27, 2018 Lisa Yan CS 09 Combinatorics Lecture Notes # June 7, 08 Handout by Chris Piech, with examples by Mehran Sahami As we mentioned last class, the principles of counting are core to probability. Counting is

More information

LECTURE VI: LOSSLESS COMPRESSION ALGORITHMS DR. OUIEM BCHIR

LECTURE VI: LOSSLESS COMPRESSION ALGORITHMS DR. OUIEM BCHIR 1 LECTURE VI: LOSSLESS COMPRESSION ALGORITHMS DR. OUIEM BCHIR 2 STORAGE SPACE Uncompressed graphics, audio, and video data require substantial storage capacity. Storing uncompressed video is not possible

More information

MT 430 Intro to Number Theory MIDTERM 2 PRACTICE

MT 430 Intro to Number Theory MIDTERM 2 PRACTICE MT 40 Intro to Number Theory MIDTERM 2 PRACTICE Material covered Midterm 2 is comrehensive but will focus on the material of all the lectures from February 9 u to Aril 4 Please review the following toics

More information

Adversary Search. Ref: Chapter 5

Adversary Search. Ref: Chapter 5 Adversary Search Ref: Chapter 5 1 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans is possible. Many games can be modeled very easily, although

More information

CS 540-2: Introduction to Artificial Intelligence Homework Assignment #2. Assigned: Monday, February 6 Due: Saturday, February 18

CS 540-2: Introduction to Artificial Intelligence Homework Assignment #2. Assigned: Monday, February 6 Due: Saturday, February 18 CS 540-2: Introduction to Artificial Intelligence Homework Assignment #2 Assigned: Monday, February 6 Due: Saturday, February 18 Hand-In Instructions This assignment includes written problems and programming

More information

MITOCW R11. Principles of Algorithm Design

MITOCW R11. Principles of Algorithm Design MITOCW R11. Principles of Algorithm Design The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources

More information

Permutations. Example 1. Lecture Notes #2 June 28, Will Monroe CS 109 Combinatorics

Permutations. Example 1. Lecture Notes #2 June 28, Will Monroe CS 109 Combinatorics Will Monroe CS 09 Combinatorics Lecture Notes # June 8, 07 Handout by Chris Piech, with examples by Mehran Sahami As we mentioned last class, the principles of counting are core to probability. Counting

More information

Entropy Coding. Outline. Entropy. Definitions. log. A = {a, b, c, d, e}

Entropy Coding. Outline. Entropy. Definitions. log. A = {a, b, c, d, e} Outline efinition of ntroy Three ntroy coding techniques: Huffman coding rithmetic coding Lemel-Ziv coding ntroy oding (taken from the Technion) ntroy ntroy of a set of elements e,,e n with robabilities,

More information

A New Method for the Visualization Binary Trees using L-Systems

A New Method for the Visualization Binary Trees using L-Systems A New Method for the Visualization Binary Trees using L-Systems A.M.Ponraj Abstract A drawing of a binary tree T maps each node of T to a distinct point in the plane and each edge (u v) of T to a chain

More information

Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers.

Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers. Solutions to Exam 1 Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively rime ositive integers. Prove that m φ(n) + n φ(m) 1 (mod mn). c) Find the remainder of 1 008

More information

Module 3 Greedy Strategy

Module 3 Greedy Strategy Module 3 Greedy Strategy Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu Introduction to Greedy Technique Main

More information

COCI 2008/2009 Contest #3, 13 th December 2008 TASK PET KEMIJA CROSS MATRICA BST NAJKRACI

COCI 2008/2009 Contest #3, 13 th December 2008 TASK PET KEMIJA CROSS MATRICA BST NAJKRACI TASK PET KEMIJA CROSS MATRICA BST NAJKRACI standard standard time limit second second second 0. seconds second 5 seconds memory limit MB MB MB MB MB MB points 0 0 70 0 0 0 500 Task PET In the popular show

More information

Adversarial Search 1

Adversarial Search 1 Adversarial Search 1 Adversarial Search The ghosts trying to make pacman loose Can not come up with a giant program that plans to the end, because of the ghosts and their actions Goal: Eat lots of dots

More information

Will Monroe June 28, with materials by Mehran Sahami and Chris Piech. Combinatorics

Will Monroe June 28, with materials by Mehran Sahami and Chris Piech. Combinatorics Will Monroe June 28, 27 with materials by Mehran Sahami and Chris Piech Combinatorics Review: Course website https://cs9.stanford.edu/ Logistics: Problem Set 4 questions (#: tell me about yourself!) Due:

More information

Past questions from the last 6 years of exams for programming 101 with answers.

Past questions from the last 6 years of exams for programming 101 with answers. 1 Past questions from the last 6 years of exams for programming 101 with answers. 1. Describe bubble sort algorithm. How does it detect when the sequence is sorted and no further work is required? Bubble

More information

On Symmetric Key Broadcast Encryption

On Symmetric Key Broadcast Encryption On Symmetric Key Broadcast Encryption Sanjay Bhattacherjee and Palash Sarkar Indian Statistical Institute, Kolkata Elliptic Curve Cryptography (This is not) 2014 Bhattacherjee and Sarkar Symmetric Key

More information

CMPUT 396 Tic-Tac-Toe Game

CMPUT 396 Tic-Tac-Toe Game CMPUT 396 Tic-Tac-Toe Game Recall minimax: - For a game tree, we find the root minimax from leaf values - With minimax we can always determine the score and can use a bottom-up approach Why use minimax?

More information

Math 124 Homework 5 Solutions

Math 124 Homework 5 Solutions Math 12 Homework 5 Solutions by Luke Gustafson Fall 2003 1. 163 1 2 (mod 2 gives = 2 the smallest rime. 2a. First, consider = 2. We know 2 is not a uadratic residue if and only if 3, 5 (mod 8. By Dirichlet

More information

An Ethical Game-Theoretic Solution Concept for Two-Player Perfect-Information Games

An Ethical Game-Theoretic Solution Concept for Two-Player Perfect-Information Games An Ethical Game-Theoretic Solution Concept for Two-Player Perfect-Information Games Joshua Letchford 1, Vincent Conitzer 1, and Kamal Jain 2 1 Department of Computer Science, Duke University, Durham, NC,

More information

Lectures: Feb 27 + Mar 1 + Mar 3, 2017

Lectures: Feb 27 + Mar 1 + Mar 3, 2017 CS420+500: Advanced Algorithm Design and Analysis Lectures: Feb 27 + Mar 1 + Mar 3, 2017 Prof. Will Evans Scribe: Adrian She In this lecture we: Summarized how linear programs can be used to model zero-sum

More information

CPS331 Lecture: Search in Games last revised 2/16/10

CPS331 Lecture: Search in Games last revised 2/16/10 CPS331 Lecture: Search in Games last revised 2/16/10 Objectives: 1. To introduce mini-max search 2. To introduce the use of static evaluation functions 3. To introduce alpha-beta pruning Materials: 1.

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 42. Board Games: Alpha-Beta Search Malte Helmert University of Basel May 16, 2018 Board Games: Overview chapter overview: 40. Introduction and State of the Art 41.

More information

From Shared Memory to Message Passing

From Shared Memory to Message Passing From Shared Memory to Message Passing Stefan Schmid T-Labs / TU Berlin Some parts of the lecture, parts of the Skript and exercises will be based on the lectures of Prof. Roger Wattenhofer at ETH Zurich

More information

CSE 21 Practice Final Exam Winter 2016

CSE 21 Practice Final Exam Winter 2016 CSE 21 Practice Final Exam Winter 2016 1. Sorting and Searching. Give the number of comparisons that will be performed by each sorting algorithm if the input list of length n happens to be of the form

More information

Gateways Placement in Backbone Wireless Mesh Networks

Gateways Placement in Backbone Wireless Mesh Networks I. J. Communications, Network and System Sciences, 2009, 1, 1-89 Published Online February 2009 in SciRes (http://www.scirp.org/journal/ijcns/). Gateways Placement in Backbone Wireless Mesh Networks Abstract

More information

Universal Cycles for Permutations Theory and Applications

Universal Cycles for Permutations Theory and Applications Universal Cycles for Permutations Theory and Applications Alexander Holroyd Microsoft Research Brett Stevens Carleton University Aaron Williams Carleton University Frank Ruskey University of Victoria Combinatorial

More information

Introduction to Number Theory 2. c Eli Biham - November 5, Introduction to Number Theory 2 (12)

Introduction to Number Theory 2. c Eli Biham - November 5, Introduction to Number Theory 2 (12) Introduction to Number Theory c Eli Biham - November 5, 006 345 Introduction to Number Theory (1) Quadratic Residues Definition: The numbers 0, 1,,...,(n 1) mod n, are called uadratic residues modulo n.

More information

Twin Binary Sequences: A Nonredundant Representation for General Nonslicing Floorplan

Twin Binary Sequences: A Nonredundant Representation for General Nonslicing Floorplan IEEE TRANSACTIONS ON COMPUTER-AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS, VOL. 22, NO. 4, APRIL 2003 457 Twin Binary Sequences: A Nonredundant Representation for General Nonslicing Floorplan Evangeline

More information

Introduction to. Algorithms. Lecture 10. Prof. Piotr Indyk

Introduction to. Algorithms. Lecture 10. Prof. Piotr Indyk 6.006- Introduction to Algorithms Lecture 10 Prof. Piotr Indyk Quiz Rules Do not open this quiz booklet until directed to do so. Read all the instructions on this page When the quiz begins, write your

More information

Game-Playing & Adversarial Search

Game-Playing & Adversarial Search Game-Playing & Adversarial Search This lecture topic: Game-Playing & Adversarial Search (two lectures) Chapter 5.1-5.5 Next lecture topic: Constraint Satisfaction Problems (two lectures) Chapter 6.1-6.4,

More information

Games (adversarial search problems)

Games (adversarial search problems) Mustafa Jarrar: Lecture Notes on Games, Birzeit University, Palestine Fall Semester, 204 Artificial Intelligence Chapter 6 Games (adversarial search problems) Dr. Mustafa Jarrar Sina Institute, University

More information

HEAPABLE SEQUENCES AND SUBSEQUENCES

HEAPABLE SEQUENCES AND SUBSEQUENCES HEAPABLE SEQUENCES AND SUBSEQUENCES JOHN BYERS 1, BRENT HEERINGA 2, MICHAEL MITZENMACHER 3, AND GEORGIOS ZERVAS 1 Abstract. Let us call a sequence of numbers heapable if they can be sequentially inserted

More information

TIME- OPTIMAL CONVERGECAST IN SENSOR NETWORKS WITH MULTIPLE CHANNELS

TIME- OPTIMAL CONVERGECAST IN SENSOR NETWORKS WITH MULTIPLE CHANNELS TIME- OPTIMAL CONVERGECAST IN SENSOR NETWORKS WITH MULTIPLE CHANNELS A Thesis by Masaaki Takahashi Bachelor of Science, Wichita State University, 28 Submitted to the Department of Electrical Engineering

More information

Parallel Operation of Dynex IGBT Modules Application Note Replaces October 2001, version AN AN July 2002

Parallel Operation of Dynex IGBT Modules Application Note Replaces October 2001, version AN AN July 2002 AN5505 Parallel Oeration of Dynex GB odules Alication Note Relaces October 2001, version AN5505-1.2 AN5505-1.3 July 2002 NRODUCON GB modules can be connected in arallel to create a switch with a higher

More information

Computing Explanations for the Unary Resource Constraint

Computing Explanations for the Unary Resource Constraint Computing Explanations for the Unary Resource Constraint Petr Vilím Charles University Faculty of Mathematics and Physics Malostranské náměstí 2/25, Praha 1, Czech Republic vilim@kti.mff.cuni.cz Abstract.

More information

Data Gathering. Chapter 4. Ad Hoc and Sensor Networks Roger Wattenhofer 4/1

Data Gathering. Chapter 4. Ad Hoc and Sensor Networks Roger Wattenhofer 4/1 Data Gathering Chapter 4 Ad Hoc and Sensor Networks Roger Wattenhofer 4/1 Environmental Monitoring (PermaSense) Understand global warming in alpine environment Harsh environmental conditions Swiss made

More information

Heapable Sequences and Subseqeuences

Heapable Sequences and Subseqeuences Heapable Sequences and Subseqeuences John Byers Brent Heeringa Michael Mitzenmacher Georgios Zervas Abstract Let us call a sequence of numbers heapable if they can be sequentially inserted to form a binary

More information

Lecture 14. Questions? Friday, February 10 CS 430 Artificial Intelligence - Lecture 14 1

Lecture 14. Questions? Friday, February 10 CS 430 Artificial Intelligence - Lecture 14 1 Lecture 14 Questions? Friday, February 10 CS 430 Artificial Intelligence - Lecture 14 1 Outline Chapter 5 - Adversarial Search Alpha-Beta Pruning Imperfect Real-Time Decisions Stochastic Games Friday,

More information

2004 Denison Spring Programming Contest 1

2004 Denison Spring Programming Contest 1 24 Denison Spring Programming Contest 1 Problem : 4 Square It s been known for over 2 years that every positive integer can be written in the form x 2 + y 2 + z 2 + w 2, for x,y,z,w non-negative integers.

More information

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn.

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn. CSE 332: ata Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning This handout describes the most essential algorithms for game-playing computers. NOTE: These are only partial algorithms:

More information

Permutation Editing and Matching via Embeddings

Permutation Editing and Matching via Embeddings Permutation Editing and Matching via Embeddings Graham Cormode, S. Muthukrishnan, Cenk Sahinalp (grahamc@dcs.warwick.ac.uk) Permutation Editing and Matching Why study permutations? Distances between permutations

More information

Switching threshold. Switch delay model. Input pattern effects on delay

Switching threshold. Switch delay model. Input pattern effects on delay Switching threshold Low Power VLSI System Design Lecture 8 & 9: Transistor Sizing and Low Power Memory Design Prof. R. Iris ahar October & 4, 017 Define V M to be the oint where V in = V out (both PMOS

More information

Complete and Incomplete Algorithms for the Queen Graph Coloring Problem

Complete and Incomplete Algorithms for the Queen Graph Coloring Problem Complete and Incomplete Algorithms for the Queen Graph Coloring Problem Michel Vasquez and Djamal Habet 1 Abstract. The queen graph coloring problem consists in covering a n n chessboard with n queens,

More information

game tree complete all possible moves

game tree complete all possible moves Game Trees Game Tree A game tree is a tree the nodes of which are positions in a game and edges are moves. The complete game tree for a game is the game tree starting at the initial position and containing

More information

Enumeration of Pin-Permutations

Enumeration of Pin-Permutations Enumeration of Pin-Permutations Frédérique Bassino, athilde Bouvel, Dominique Rossin To cite this version: Frédérique Bassino, athilde Bouvel, Dominique Rossin. Enumeration of Pin-Permutations. 2008.

More information

16.410/413 Principles of Autonomy and Decision Making

16.410/413 Principles of Autonomy and Decision Making 16.10/13 Principles of Autonomy and Decision Making Lecture 2: Sequential Games Emilio Frazzoli Aeronautics and Astronautics Massachusetts Institute of Technology December 6, 2010 E. Frazzoli (MIT) L2:

More information

PARTS SIDE PLATE TOP MOUNT BLOCK BOTTOM MOUNT FIRST TREAD SUPPORT TREAD INTERMEDIATE PANEL UPPER CABLE BALUSTER INTERMEDIATE CABLE

PARTS SIDE PLATE TOP MOUNT BLOCK BOTTOM MOUNT FIRST TREAD SUPPORT TREAD INTERMEDIATE PANEL UPPER CABLE BALUSTER INTERMEDIATE CABLE ARTS 1 2 3 BLOCK SIDE LATE TO MOUNT 4 5 6 BOTTOM MOUNT FIRST TREAD SUORT TREAD 7 8 9 LOWER ANEL BALUSTER INTERMEDIATE ANEL BALUSTER UER ANEL BALUSTER 10 11 12 LOWER CABLE BALUSTER INTERMEDIATE CABLE BALUSTER

More information

AIMA 3.5. Smarter Search. David Cline

AIMA 3.5. Smarter Search. David Cline AIMA 3.5 Smarter Search David Cline Uninformed search Depth-first Depth-limited Iterative deepening Breadth-first Bidirectional search None of these searches take into account how close you are to the

More information

CS 771 Artificial Intelligence. Adversarial Search

CS 771 Artificial Intelligence. Adversarial Search CS 771 Artificial Intelligence Adversarial Search Typical assumptions Two agents whose actions alternate Utility values for each agent are the opposite of the other This creates the adversarial situation

More information

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur Module 3 Problem Solving using Search- (Two agent) 3.1 Instructional Objective The students should understand the formulation of multi-agent search and in detail two-agent search. Students should b familiar

More information

Module 3 Greedy Strategy

Module 3 Greedy Strategy Module 3 Greedy Strategy Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu Introduction to Greedy Technique Main

More information

Tree representation Utility function

Tree representation Utility function N. H. N. D. de Silva Two Person Perfect Information Deterministic Game Tree representation Utility function Two Person Perfect ti nformation Deterministic Game Two players take turns making moves Board

More information

COS 226 Algorithms and Data Structures Fall Midterm Exam

COS 226 Algorithms and Data Structures Fall Midterm Exam COS 226 lgorithms and Data Structures Fall 2015 Midterm Exam This exam has 8 questions worth a total of 100 points. You have 80 minutes. The exam is closed book, except that you are allowed to use one

More information

Adverserial Search Chapter 5 minmax algorithm alpha-beta pruning TDDC17. Problems. Why Board Games?

Adverserial Search Chapter 5 minmax algorithm alpha-beta pruning TDDC17. Problems. Why Board Games? TDDC17 Seminar 4 Adversarial Search Constraint Satisfaction Problems Adverserial Search Chapter 5 minmax algorithm alpha-beta pruning 1 Why Board Games? 2 Problems Board games are one of the oldest branches

More information

COS 226 Algorithms and Data Structures Fall Midterm Exam

COS 226 Algorithms and Data Structures Fall Midterm Exam COS 226 lgorithms and Data Structures Fall 2015 Midterm Exam You have 80 minutes for this exam. The exam is closed book, except that you are allowed to use one page of notes (8.5-by-11, one side, in your

More information

SEARCHING is both a method of solving problems and

SEARCHING is both a method of solving problems and 100 IEEE TRANSACTIONS ON COMPUTATIONAL INTELLIGENCE AND AI IN GAMES, VOL. 3, NO. 2, JUNE 2011 Two-Stage Monte Carlo Tree Search for Connect6 Shi-Jim Yen, Member, IEEE, and Jung-Kuei Yang Abstract Recently,

More information

Hypercube Networks-III

Hypercube Networks-III 6.895 Theory of Parallel Systems Lecture 18 ypercube Networks-III Lecturer: harles Leiserson Scribe: Sriram Saroop and Wang Junqing Lecture Summary 1. Review of the previous lecture This section highlights

More information

STAJSIC, DAVORIN, M.A. Combinatorial Game Theory (2010) Directed by Dr. Clifford Smyth. pp.40

STAJSIC, DAVORIN, M.A. Combinatorial Game Theory (2010) Directed by Dr. Clifford Smyth. pp.40 STAJSIC, DAVORIN, M.A. Combinatorial Game Theory (2010) Directed by Dr. Clifford Smyth. pp.40 Given a combinatorial game, can we determine if there exists a strategy for a player to win the game, and can

More information

7.1 INTRODUCTION TO PERIODIC FUNCTIONS

7.1 INTRODUCTION TO PERIODIC FUNCTIONS 7.1 INTRODUCTION TO PERIODIC FUNCTIONS Ferris Wheel Height As a Function of Time The London Eye Ferris Wheel measures 450 feet in diameter and turns continuously, completing a single rotation once every

More information