amortization

Amortized analysis on Heap

风格不统一 提交于 2019-12-24 14:27:55
问题 When I ran to this topic. I read in this book on the bottom of page 5-1 that Binomial Queues , Fibonacci Heap and Skew Heap have O(1) amortized cost for insert operations and O(log n) amortized cost of delete operations. Next the authors write that the Pairing Heap has O(1) amortized cost for insert operations and O(log n) amortized cost for delete operations. on this homework the third (3) assignment and solution on this link without defining the type of heap wrote O(log n) for insert and O

amortized analysis on min-heap?

南楼画角 提交于 2019-11-30 18:24:51
问题 If on empty min heap we doing n arbitrary insert and delete operations, (with given location of delete in min-heap). why the amortized analysis for insert is O(1) and delete is O(log n) ? a) insert O(log n), delete O(1) b) insert O(log n), delete O(log n) c) insert O(1), delete O(1) d) insert O(1), delete O(log n) any person could clarify it for me? 回答1: Based on your question and responses to comments, I'm going to assume a binary heap. First, the worst case for insertion is O(log n) and the