NTA UGC NET JUNE-2023 Paper-2
December 3, 2023Artificial-Intelligence
December 3, 2023NTA UGC NET JUNE-2023 Paper-2
Question 22
|
A.The MAX-HEAPIFY procedure which runs in O lg(n) time, is the key to maintaining the max heap property
B. The BUILD-MAX-HEAP procedure which runs in O lg(n) time,produces max-heap from an unordered input array
C. The MAX-HEAP-INSERT, which runs in O(lg n) time, implements the insertion operation
D.The HEAP-INCREASE-KEY procedure runs in O(nlg n) time, to set the key of new node of its correct value
Choose the correct answer from the options given below
A,B only
|
|
A,C only
|
|
B,D only
|
|
A,B,C,D
|
B. The statement “The BUILD-MAX-HEAP procedure which runs in O(log n) time, produces a max-heap from an unordered input array” is incorrect. BUILD-MAX-HEAP typically runs in O(n) time, not O(log n) time. It’s used to create a max-heap from an unordered array.
C. The statement “The MAX-HEAP-INSERT, which runs in O(log n) time, implements the insertion operation” is correct. MAX-HEAP-INSERT is used for inserting elements into a max-heap and typically runs in O(log n) time.
D. The statement “The HEAP-INCREASE-KEY procedure runs in O(n log n) time, to set the key of a new node to its correct value” is incorrect. HEAP-INCREASE-KEY usually runs in O(log n) time, not O(n log n) time.
So, the correct statements are A and C
B. The statement “The BUILD-MAX-HEAP procedure which runs in O(log n) time, produces a max-heap from an unordered input array” is incorrect. BUILD-MAX-HEAP typically runs in O(n) time, not O(log n) time. It’s used to create a max-heap from an unordered array.
C. The statement “The MAX-HEAP-INSERT, which runs in O(log n) time, implements the insertion operation” is correct. MAX-HEAP-INSERT is used for inserting elements into a max-heap and typically runs in O(log n) time.
D. The statement “The HEAP-INCREASE-KEY procedure runs in O(n log n) time, to set the key of a new node to its correct value” is incorrect. HEAP-INCREASE-KEY usually runs in O(log n) time, not O(n log n) time.
So, the correct statements are A and C