• 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. Keyboard
    2. Scanner
    3. OMR
    4. None of the above
    اس سوال کو وضاحت کے ساتھ پڑھیں

    ڈاس میں فائل کے نام کی زیادہ سے زیادہ لمبائی کتنی ہوتی ہے؟
    1. 8
    2. 5
    3. 3
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    درج ذیل میں سے آپریٹنگ سسٹم کی مثال کون سی ہے؟
    1. Photoshop
    2. MS Windows
    3. MS Word
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    کمپیوٹر وائرس کی وہ کون سی قسم ہے جو خود کو ایک جائز پروگرام یا فائل کے طور پر ظاہر کرتی ہے؟
    1. Spyware
    2. Trojan horse
    3. Worm
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    ریم سے کیا مراد ہے؟
    1. Random Access Memory
    2. Random Access Money
    3. Random Accurate Memory
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    All Rights Reserved © TestPointpk.com