Princeton Algorithms: Part 1 [week 4: Priority Queues]

来源:互联网 发布:sql sequence是什么 编辑:程序博客网 时间:2024/05/16 12:41

Exercises


Explanation:
The correct answer is: 98 94 83 66 86 52 46 50 21 77 54 11 20

Here is the sequence of keys in the array after each insertion:

98 94 52 66 86 20 46 50 21 77
54: 98 94 52 66 86 20 46 50 21 77 54
11: 98 94 52 66 86 20 46 50 21 77 54 11
83: 98 94 83 66 86 52 46 50 21 77 54 11 20



Explanation:
The correct answer is: 70 39 65 18 36 48 55

Here is the sequence of keys in the array after each deletion:

85 79 81 39 70 48 55 18 36 65
[ 85 deleted ] 81 79 65 39 70 48 55 18 36
[ 81 deleted ] 79 70 65 39 36 48 55 18
[ 79 deleted ] 70 39 65 18 36 48 55





Job Interview Questions









0 0
原创粉丝点击