Submit Search
Upload
5.4 randamized algorithm
•
Download as PPT, PDF
•
2 likes
•
593 views
K
Krish_ver2
Follow
Data Structure-randamized algorithm
Read less
Read more
Education
Report
Share
Report
Share
1 of 11
Download now
Recommended
Edu presentation1
Edu presentation1
hook1kf
Lec9
Lec9
Nikhil Chilwant
Explicit Formula for Riemann Prime Counting Function
Explicit Formula for Riemann Prime Counting Function
Kannan Nambiar
Stack, queue, linked list
Stack, queue, linked list
Sonali Mhatre
평범한 이야기[Intro: 2015 의기제]
평범한 이야기[Intro: 2015 의기제]
대호 이
4.1 webminig
4.1 webminig
Krish_ver2
5.4 randomized datastructures
5.4 randomized datastructures
Krish_ver2
160607 14 sw교육_강의안
160607 14 sw교육_강의안
Choi Man Dream
Recommended
Edu presentation1
Edu presentation1
hook1kf
Lec9
Lec9
Nikhil Chilwant
Explicit Formula for Riemann Prime Counting Function
Explicit Formula for Riemann Prime Counting Function
Kannan Nambiar
Stack, queue, linked list
Stack, queue, linked list
Sonali Mhatre
평범한 이야기[Intro: 2015 의기제]
평범한 이야기[Intro: 2015 의기제]
대호 이
4.1 webminig
4.1 webminig
Krish_ver2
5.4 randomized datastructures
5.4 randomized datastructures
Krish_ver2
160607 14 sw교육_강의안
160607 14 sw교육_강의안
Choi Man Dream
5.2 divede and conquer 03
5.2 divede and conquer 03
Krish_ver2
4.2 bst 03
4.2 bst 03
Krish_ver2
RESUME-ARITRA BHOWMIK
RESUME-ARITRA BHOWMIK
Aritra Bhowmik
4.4 hashing02
4.4 hashing02
Krish_ver2
1.9 b trees eg 03
1.9 b trees eg 03
Krish_ver2
РЕКЛАМНЫЕ МОДЕЛИ
РЕКЛАМНЫЕ МОДЕЛИ
Moscow State University of Printing Arts
Top Forex Brokers
Top Forex Brokers
Fxmoneyworld LTD
문제는 한글이 잘 구현되는가?
문제는 한글이 잘 구현되는가?
Choi Man Dream
4.2 bst 02
4.2 bst 02
Krish_ver2
Online Trading Concepts
Online Trading Concepts
Fxmoneyworld LTD
2.4 mst prim &kruskal demo
2.4 mst prim &kruskal demo
Krish_ver2
nhận thiết kế clip quảng cáo giá tốt
nhận thiết kế clip quảng cáo giá tốt
raul110
1.9 b trees 02
1.9 b trees 02
Krish_ver2
Salario minimo basico
Salario minimo basico
veritotcarrillo
CV Belinda Wahl 2015
CV Belinda Wahl 2015
Belinda Wahl
5.3 dyn algo-i
5.3 dyn algo-i
Krish_ver2
2.4 mst kruskal’s
2.4 mst kruskal’s
Krish_ver2
trabajo de cultural
trabajo de cultural
argelures
5.1 greedyyy 02
5.1 greedyyy 02
Krish_ver2
Madhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business Analyst
Madhumita Bairagi
Skip lists (Advance Data structure)
Skip lists (Advance Data structure)
Shubham Shukla
computer notes - Data Structures - 34
computer notes - Data Structures - 34
ecomputernotes
More Related Content
Viewers also liked
5.2 divede and conquer 03
5.2 divede and conquer 03
Krish_ver2
4.2 bst 03
4.2 bst 03
Krish_ver2
RESUME-ARITRA BHOWMIK
RESUME-ARITRA BHOWMIK
Aritra Bhowmik
4.4 hashing02
4.4 hashing02
Krish_ver2
1.9 b trees eg 03
1.9 b trees eg 03
Krish_ver2
РЕКЛАМНЫЕ МОДЕЛИ
РЕКЛАМНЫЕ МОДЕЛИ
Moscow State University of Printing Arts
Top Forex Brokers
Top Forex Brokers
Fxmoneyworld LTD
문제는 한글이 잘 구현되는가?
문제는 한글이 잘 구현되는가?
Choi Man Dream
4.2 bst 02
4.2 bst 02
Krish_ver2
Online Trading Concepts
Online Trading Concepts
Fxmoneyworld LTD
2.4 mst prim &kruskal demo
2.4 mst prim &kruskal demo
Krish_ver2
nhận thiết kế clip quảng cáo giá tốt
nhận thiết kế clip quảng cáo giá tốt
raul110
1.9 b trees 02
1.9 b trees 02
Krish_ver2
Salario minimo basico
Salario minimo basico
veritotcarrillo
CV Belinda Wahl 2015
CV Belinda Wahl 2015
Belinda Wahl
5.3 dyn algo-i
5.3 dyn algo-i
Krish_ver2
2.4 mst kruskal’s
2.4 mst kruskal’s
Krish_ver2
trabajo de cultural
trabajo de cultural
argelures
5.1 greedyyy 02
5.1 greedyyy 02
Krish_ver2
Madhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business Analyst
Madhumita Bairagi
Viewers also liked
(20)
5.2 divede and conquer 03
5.2 divede and conquer 03
4.2 bst 03
4.2 bst 03
RESUME-ARITRA BHOWMIK
RESUME-ARITRA BHOWMIK
4.4 hashing02
4.4 hashing02
1.9 b trees eg 03
1.9 b trees eg 03
РЕКЛАМНЫЕ МОДЕЛИ
РЕКЛАМНЫЕ МОДЕЛИ
Top Forex Brokers
Top Forex Brokers
문제는 한글이 잘 구현되는가?
문제는 한글이 잘 구현되는가?
4.2 bst 02
4.2 bst 02
Online Trading Concepts
Online Trading Concepts
2.4 mst prim &kruskal demo
2.4 mst prim &kruskal demo
nhận thiết kế clip quảng cáo giá tốt
nhận thiết kế clip quảng cáo giá tốt
1.9 b trees 02
1.9 b trees 02
Salario minimo basico
Salario minimo basico
CV Belinda Wahl 2015
CV Belinda Wahl 2015
5.3 dyn algo-i
5.3 dyn algo-i
2.4 mst kruskal’s
2.4 mst kruskal’s
trabajo de cultural
trabajo de cultural
5.1 greedyyy 02
5.1 greedyyy 02
Madhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business Analyst
Similar to 5.4 randamized algorithm
Skip lists (Advance Data structure)
Skip lists (Advance Data structure)
Shubham Shukla
computer notes - Data Structures - 34
computer notes - Data Structures - 34
ecomputernotes
Computer notes - Binary Search
Computer notes - Binary Search
ecomputernotes
computer notes - Data Structures - 32
computer notes - Data Structures - 32
ecomputernotes
Skip list vinay khimsuriya_200430723005
Skip list vinay khimsuriya_200430723005
vinaykhimsuriya1
Lecture12,13,14.pdf
Lecture12,13,14.pdf
zainab278016
In three of the exercises below there is given a code of a method na.pdf
In three of the exercises below there is given a code of a method na.pdf
feelinggift
Sortsearch
Sortsearch
Krishna Chaytaniah
Sorting
Sorting
Saurabh Mishra
Chapter-2.pptx
Chapter-2.pptx
selemonGamo
2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list
kinan keshkeh
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
R Islam
time_complexity_list_02_04_2024_22_pages.pdf
time_complexity_list_02_04_2024_22_pages.pdf
SrinivasaReddyPolamR
Similar to 5.4 randamized algorithm
(13)
Skip lists (Advance Data structure)
Skip lists (Advance Data structure)
computer notes - Data Structures - 34
computer notes - Data Structures - 34
Computer notes - Binary Search
Computer notes - Binary Search
computer notes - Data Structures - 32
computer notes - Data Structures - 32
Skip list vinay khimsuriya_200430723005
Skip list vinay khimsuriya_200430723005
Lecture12,13,14.pdf
Lecture12,13,14.pdf
In three of the exercises below there is given a code of a method na.pdf
In three of the exercises below there is given a code of a method na.pdf
Sortsearch
Sortsearch
Sorting
Sorting
Chapter-2.pptx
Chapter-2.pptx
2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
time_complexity_list_02_04_2024_22_pages.pdf
time_complexity_list_02_04_2024_22_pages.pdf
More from Krish_ver2
5.5 back tracking
5.5 back tracking
Krish_ver2
5.5 back track
5.5 back track
Krish_ver2
5.5 back tracking 02
5.5 back tracking 02
Krish_ver2
5.4 randomized datastructures
5.4 randomized datastructures
Krish_ver2
5.3 dynamic programming 03
5.3 dynamic programming 03
Krish_ver2
5.3 dynamic programming
5.3 dynamic programming
Krish_ver2
5.2 divede and conquer 03
5.2 divede and conquer 03
Krish_ver2
5.2 divide and conquer
5.2 divide and conquer
Krish_ver2
5.1 greedy
5.1 greedy
Krish_ver2
5.1 greedy 03
5.1 greedy 03
Krish_ver2
4.4 hashing
4.4 hashing
Krish_ver2
4.4 hashing ext
4.4 hashing ext
Krish_ver2
4.4 external hashing
4.4 external hashing
Krish_ver2
4.2 bst
4.2 bst
Krish_ver2
4.1 sequentioal search
4.1 sequentioal search
Krish_ver2
3.9 external sorting
3.9 external sorting
Krish_ver2
3.8 quicksort
3.8 quicksort
Krish_ver2
3.8 quick sort
3.8 quick sort
Krish_ver2
3.8 quicksort 04
3.8 quicksort 04
Krish_ver2
3.7 heap sort
3.7 heap sort
Krish_ver2
More from Krish_ver2
(20)
5.5 back tracking
5.5 back tracking
5.5 back track
5.5 back track
5.5 back tracking 02
5.5 back tracking 02
5.4 randomized datastructures
5.4 randomized datastructures
5.3 dynamic programming 03
5.3 dynamic programming 03
5.3 dynamic programming
5.3 dynamic programming
5.2 divede and conquer 03
5.2 divede and conquer 03
5.2 divide and conquer
5.2 divide and conquer
5.1 greedy
5.1 greedy
5.1 greedy 03
5.1 greedy 03
4.4 hashing
4.4 hashing
4.4 hashing ext
4.4 hashing ext
4.4 external hashing
4.4 external hashing
4.2 bst
4.2 bst
4.1 sequentioal search
4.1 sequentioal search
3.9 external sorting
3.9 external sorting
3.8 quicksort
3.8 quicksort
3.8 quick sort
3.8 quick sort
3.8 quicksort 04
3.8 quicksort 04
3.7 heap sort
3.7 heap sort
Recently uploaded
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
Eyham Joco
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
Celine George
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
iammrhaywood
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
NirmalaLoungPoorunde1
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
mkooblal
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
YousafMalik24
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
SpandanaRallapalli
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
SherlyMaeNeri
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
National Information Standards Organization (NISO)
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
Nguyen Thanh Tu Collection
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
SamikshaHamane
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
LigayaBacuel1
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
phamnguyenenglishnb
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
OH TEIK BIN
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
MakMakNepo
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
Mark Reed
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
UjwalaBharambe
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
pboyjonauth
Recently uploaded
(20)
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
5.4 randamized algorithm
1.
Skip Lists 1©
2004 Goodrich, Tamassia Skip Lists +∞−∞ S0 S1 S2 S3 +∞−∞ 10 362315 +∞−∞ 15 +∞−∞ 2315
2.
Skip Lists 2©
2004 Goodrich, Tamassia What is a Skip List A skip list for a set S of distinct (key, element) items is a series of lists S0, S1, … , Sh such that Each list Si contains the special keys +∞ and −∞ List S0 contains the keys of S in nondecreasing order Each list is a subsequence of the previous one, i.e., S0 ⊇S1 ⊇ … ⊇ Sh List Shcontains only the two special keys We show how to use a skip list to implement the dictionary ADT 56 64 78 +∞31 34 44−∞ 12 23 26 +∞−∞ +∞31−∞ 64 +∞31 34−∞ 23 S0 S1 S2 S3
3.
Skip Lists 3©
2004 Goodrich, Tamassia Search We search for a key x in a a skip list as follows: We start at the first position of the top list At the current position p, we compare x with y ← key(next(p)) x = y: we return element(next(p)) x > y: we “scan forward” x < y: we “drop down” If we try to drop down past the bottom list, we return null Example: search for 78 +∞−∞ S0 S1 S2 S3 +∞31−∞ 64 +∞31 34−∞ 23 56 64 78 +∞31 34 44−∞ 12 23 26
4.
Skip Lists 4©
2004 Goodrich, Tamassia Randomized Algorithms A randomized algorithm performs coin tosses (i.e., uses random bits) to control its execution It contains statements of the type b ← random() if b = 0 do A … else { b = 1} do B … Its running time depends on the outcomes of the coin tosses We analyze the expected running time of a randomized algorithm under the following assumptions the coins are unbiased, and the coin tosses are independent The worst-case running time of a randomized algorithm is often large but has very low probability (e.g., it occurs when all the coin tosses give “heads”) We use a randomized algorithm to insert items into a skip list
5.
Skip Lists 5©
2004 Goodrich, Tamassia To insert an entry (x, o) into a skip list, we use a randomized algorithm: We repeatedly toss a coin until we get tails, and we denote with i the number of times the coin came up heads If i ≥ h, we add to the skip list new lists Sh+1, … , Si+1, each containing only the two special keys We search for x in the skip list and find the positions p0, p1, …, piof the items with largest key less than x in each list S0, S1, … , Si For j ← 0, …, i, we insert item (x, o) into list Sj after position pj Example: insert key 15, with i = 2 Insertion +∞−∞ 10 36 +∞−∞ 23 23 +∞−∞ S0 S1 S2 +∞−∞ S0 S1 S2 S3 +∞−∞ 10 362315 +∞−∞ 15 +∞−∞ 2315 p0 p1 p2
6.
Skip Lists 6©
2004 Goodrich, Tamassia Deletion To remove an entry with key x from a skip list, we proceed as follows: We search for x in the skip list and find the positions p0, p1 , …, pi of the items with key x, where position pj is in list Sj We remove positions p0, p1 , …, pi from the lists S0, S1, … , Si We remove all but one list containing only the two special keys Example: remove key 34 −∞ +∞4512 −∞ +∞ 23 23−∞ +∞ S0 S1 S2 −∞ +∞ S0 S1 S2 S3 −∞ +∞4512 23 34 −∞ +∞34 −∞ +∞23 34 p0 p1 p2
7.
Skip Lists 7©
2004 Goodrich, Tamassia Implementation We can implement a skip list with quad-nodes A quad-node stores: entry link to the node prev link to the node next link to the node below link to the node above Also, we define special keys PLUS_INF and MINUS_INF, and we modify the key comparator to handle them x quad-node
8.
Skip Lists 8©
2004 Goodrich, Tamassia Space Usage The space used by a skip list depends on the random bits used by each invocation of the insertion algorithm We use the following two basic probabilistic facts: Fact 1: The probability of getting i consecutive heads when flipping a coin is 1/2i Fact 2: If each of n entries is present in a set with probability p, the expected size of the set is np Consider a skip list with n entries By Fact 1, we insert an entry in list Si with probability 1/2i By Fact 2, the expected size of list Si is n/2i The expected number of nodes used by the skip list is nn n h i i h i i 2 2 1 2 00 <= ∑∑ == Thus, the expected space usage of a skip list with n items is O(n)
9.
Skip Lists 9©
2004 Goodrich, Tamassia Height The running time of the search an insertion algorithms is affected by the height h of the skip list We show that with high probability, a skip list with n items has height O(log n) We use the following additional probabilistic fact: Fact 3: If each of n events has probability p, the probability that at least one event occurs is at most np Consider a skip list with n entires By Fact 1, we insert an entry in list Si with probability 1/2i By Fact 3, the probability that list Si has at least one item is at most n/2i By picking i = 3log n, we have that the probability that S3logn has at least one entry is at most n/23logn = n/n3 = 1/n2 Thus a skip list with n entries has height at most 3log n with probability at least 1 − 1/n2
10.
Skip Lists 10©
2004 Goodrich, Tamassia Search and Update Times The search time in a skip list is proportional to the number of drop-down steps, plus the number of scan-forward steps The drop-down steps are bounded by the height of the skip list and thus are O(log n) with high probability To analyze the scan-forward steps, we use yet another probabilistic fact: Fact 4: The expected number of coin tosses required in order to get tails is 2 When we scan forward in a list, the destination key does not belong to a higher list A scan-forward step is associated with a former coin toss that gave tails By Fact 4, in each list the expected number of scan- forward steps is 2 Thus, the expected number of scan-forward steps is O(log n) We conclude that a search in a skip list takes O(log n) expected time The analysis of insertion and deletion gives similar results
11.
Skip Lists 11©
2004 Goodrich, Tamassia Summary A skip list is a data structure for dictionaries that uses a randomized insertion algorithm In a skip list with n entries The expected space used is O(n) The expected search, insertion and deletion time is O(log n) Using a more complex probabilistic analysis, one can show that these performance bounds also hold with high probability Skip lists are fast and simple to implement in practice
Download now