• 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. Pixels
    2. Hertz
    3. Megabytes
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    کمپیوٹر کا جسمانی حصہ کسے کہتے ہیں؟
    1. Software
    2. Hardware
    3. Both A and B
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    کس قسم کے ٹرمینل میں اپنا پروسیسر ہوتا ہے اور جو آزادانہ طور پر حساب کتاب اور ڈیٹا پراسیس کر سکتا ہے؟
    1. Dumb Terminal
    2. Smart Terminal
    3. Intelligent Terminal
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    سافٹ ویئر یا ہارڈ ویئر میں خرابی کو بگ کہا جاتا ہے۔ اس کے لیے متبادل کمپیوٹر جرگن کیا ہے؟
    1. Glitch
    2. Squid
    3. Slug
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    سمورغ نامی سپر کمپیوٹر کس ملک نے تیار کیا ہے؟
    1. China
    2. Japan
    3. Iran
    4. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    All Rights Reserved © TestPointpk.com