• Call Us : 03082533000 (WhatsApp)
  • Email Us : TestPointpk.com@gmail.com
Sticky Note
What is the time complexity of a loop inside a loop, each running n times?
  1. O(n)
  2. O(log n)
  3. O(n²)
  4. O(n log n)
Explanation
  • A loop inside another loop is called a nested loop.
  • If both loops run n times, the inner loop runs n times for each iteration of the outer loop.
  • Total iterations = n × n = n².
  • Therefore, the time complexity is O(n²).
  • Related MCQs

    انٹرنیٹ کنکشن کے لیے کون سا آلہ ضروری ہے؟
    1. Joystick
    2. Modem
    3. CD drive
    4. NIC card
    اس سوال کو وضاحت کے ساتھ پڑھیں

    جنک ای میل کا دوسرا نام کیا ہے؟
    1. Spoof
    2. Spill
    3. Spam
    4. Spat
    اس سوال کو وضاحت کے ساتھ پڑھیں

    ڈاس آپریٹنگ سسٹم کس پر مبنی ہے؟
    1. Graphical User Interface
    2. Command Line Interface (CLI)
    3. Touch User Interface
    4. Voice User Interface
    اس سوال کو وضاحت کے ساتھ پڑھیں

    1. Fourth generation computer
    2. First generation computer
    3. Third generation computer
    4. Second generation computer
    5. None of these
    اس سوال کو وضاحت کے ساتھ پڑھیں

    پاس ورڈ توڑنے یا اندازے سے معلوم کرنے کے عمل کو عام طور پر کیا کہا جاتا ہے؟
    1. Hacking
    2. Phishing
    3. Cracking
    4. Formatting
    اس سوال کو وضاحت کے ساتھ پڑھیں

    All Rights Reserved © TestPointpk.com