DATA STRUCTURE AND ALGORITHM c) c) (3 marks) public static int 02(int) int x = 0 for (int i = 0; i <=10000; i++) X +i: f
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
DATA STRUCTURE AND ALGORITHM c) c) (3 marks) public static int 02(int) int x = 0 for (int i = 0; i <=10000; i++) X +i: f
DATA STRUCTURE AND ALGORITHM c) c) (3 marks) public static int 02(int) int x = 0 for (int i = 0; i <=10000; i++) X +i: for (int =0; j= 168*n; j++) for (int k = 0; k=6*n; k++) x-k: return x; 16. a) Priority queue can be implemented by array or heap, why and what situation heap would be a better choice to implement a priority queue? You are required to give only one situation and explain the reason. (4 marks) b) The following is a maximum heap array. You are required to do some operations to insert and remove element in heap. Use the result of the previous operation as you execute next operations, (6 marks) II) III) remove insert 82 change 86 to 76 Heap array: 98 86 76 76 66 58 68 50 50 43 164 (Use the following table format for your answer.) Index Pass No. 6 Original 98 86 76 76 66 58 68 i) ii) iii) 7 50 50 43 16 4 6/7
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!