What is the time complexity of inserting an element in a binary heap?
بائنری ڈھیر میں عنصر ڈالنے کی وقت کی پیچیدگی کیا ہے؟
- O(n log n)
- O(1)
- O(log n)
- None of these
Explanation
Insertion in a binary heap requires adding the element at the end and then heapifying up to maintain heap property.
The heapify operation takes logarithmic time relative to the number of elements.
Related MCQs
- Format
- Modify
- Draw
- Tools
اس سوال کو وضاحت کے ساتھ پڑھیں
- Trim
- Offset
- Extrude
- Fillet
اس سوال کو وضاحت کے ساتھ پڑھیں
بڑی اسکرین پر ویڈیو تصاویر دکھانے کے لیے کون سا آؤٹ پٹ ڈیوائس استعمال ہوتا ہے؟
- Scanner
- Printer
- Projector
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
اینٹی وائرس سافٹ ویئر کا کیا کام ہے؟
- Protect against malware and viruses
- Manage email accounts
- Create and edit spreadsheets
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
کمپیوٹر کو ایک الیکٹرانک ڈیوائس کے طور پر کیسے بیان کیا جا سکتا ہے؟
- Carry out arithmetic operations
- Carry out logical operations
- Do complicated calculations
- Accept and process by implementation sequentially a set of stored instructions