Download presentation

Presentation is loading. Please wait.

Published byClifton High Modified over 2 years ago

1
Prioritetskøer med Afskæring Rajamani Sundar, Worst-case data structures for the priority queue with attrition, Information Processing Letters, 31(2), 69-75, 1989.

2
Operationer CreateS := Ø Insert(x)S := { x } ᴜ { y S | y < x } Deleteminm := min(S); S := S \ { m }; return m

3
Løsning: Sorteret Liste CreateS := () Insert(x)while (|S|>0 and tail(S)≥x) remove_tail(S) insert_tail(x) Deletemin return remove_head(S)

4
Løsning: Sorteret Liste CreateS := () Insert(x)while (|S|>0 and tail(S)≥x) remove_tail(S) insert_tail(x) Deletemin return remove_head(S) Sætning Create, Insert og DeleteMin tager amortiseret O(1) tid Bevis: Φ(S) = |S|.□

5
Worst-Case O(1)

6
CBDfDf DrDr Invarianter 1)C, B, D f sorterede 2)max C ≤ min (B ᴜ D f ᴜ D r ) 3)|C|≥ |D f |+2|D r | 17 ≥ 4+2∙5 Løsning: 4 Lister indsættelsestidspunkt

7
CBDfDf DrDr Invarianter 1)C, B, D f sorterede 2)max C ≤ min (B ᴜ D f ᴜ D r ) 3)|C|≥ |D f |+2|D r | B IAS ≥ “+1” 1 2 3 3 2 1

8
D f +1, D r -1 B D f -1 A C C=C+D f, B=D f =0 D C +1, B -1 Invarianter 1)C, B, D f sorterede 2)max C ≤ min (B ᴜ D f ᴜ D r ) 3)|C|≥ |D f |+2|D r | B IAS ≥ “+1” A B C D CBDfDf DrDr CBDfDf DrDr CBDfDf DrDr CBDfDf DrDr

9
Sætning Create, Insert og DeleteMin tager worst-case O(1) tid CBDfDf DrDr Invarianter 1)C, B, D f sorterede 2)max C ≤ min (B ᴜ D f ᴜ D r ) 3)|C|≥ |D f |+2|D r |

Similar presentations

Presentation is loading. Please wait....

OK

CSE 373 Data Structures Lecture 12

CSE 373 Data Structures Lecture 12

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on fibonacci numbers and nature Ppt on role of entrepreneur in economic development Seminar ppt on mobile number portability Jit ppt on manufacturing jobs Ppt on cervical cancer screening Ppt on self awareness activities Ppt on pricing strategy in retail Ppt on uses of metals and nonmetals Ppt on wireless power transmission system Ppt on historical site in need of conservation