• Call Us : 03082533000 (WhatsApp)
  • Email Us : TestPointpk.com@gmail.com
Sticky Note
In a max-heap, if a node has index i (1-based indexing), what is the index of its parent?
  1. i + 1
  2. i / 2
  3. 2 * i
  4. i - 1
Explanation
  • In a max-heap using 1-based indexing, the parent of a node at index i is at index i / 2.
  • The left child of node i is at index 2 * i, and the right child is at index 2 * i + 1.
  • This property helps in efficient heap operations like insert and delete.
  • Max-heaps maintain the largest element at the root.
  • Related MCQs

    کون سا آپریٹنگ سسٹم ملتے جلتے کاموں کو گروپ بنا کر بیچز کی صورت میں چلاتا ہے؟
    1. Real-time operating system
    2. Batch operating system
    3. Distributed operating system
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    کمپیوٹر کے مدر بورڈ پر سی ایم او ایس بیٹری کا کیا کام ہے؟
    1. To power the processor
    2. To maintain system time and BIOS/UEFI settings
    3. To increase internet speed
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    درج ذیل میں سے کون سی آپٹیکل اسٹوریج ڈیوائس کی مثال ہے؟
    1. SSD
    2. DVD Drive
    3. Hard drive
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    جی این یو آپریٹنگ سسٹم کا منصوبہ کس نے شروع کیا؟
    1. Bill Gates
    2. Steve Jobs
    3. Richard Stallman
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    مندرجہ ذیل میں سے کون سی غیر مستحکم میموری ہے؟
    1. RAM
    2. ROM
    3. Cache
    4. Both A and C
    اس سوال کو وضاحت کے ساتھ پڑھیں

    All Rights Reserved © TestPointpk.com