arrow
arrow
arrow
If algorithm A and another algorithm B take log2(n)log_{2} (n)log2​(n)​ and n\sqrt{n}n​​  microseconds, respectively to solve a problem
Question



If algorithm A and another algorithm B take log2(n)log_{2} (n)​ and n\sqrt{n}​  microseconds, respectively to solve a problem, then the largest size n of a problem these algorithms can solve, respectively, in one second are _____________ and _________.

A.

2106and 106\mathrm{2^{10^6} and \ 10^6}​​

B.

2106and 1012\mathrm{2^{10^6 } and \ 10^{12}}​​

C.

2106and 6.106\mathrm{2^{10^6 } and \ 6.10^6}​​

D.

2106and 6.1012\mathrm{2^{10^6 } and \ 6.10^{12}}​​

Correct option is B

Let's break down and solve the question step by step:
Problem Given:
• Algorithm A takes log2(n)\log_2(n)​ microseconds.
• Algorithm B takes n\sqrt{n}​  microseconds.
• You need to find the largest size n that these algorithms can solve in one second.
Step 1: Convert time into microseconds

• We know that 1 second = 10610^6​ microseconds.
Step 2: Solve for the maximum n for each algorithm
For Algorithm A:

• The time taken by Algorithm A is log2(n)\log_2(n)​ microseconds.
• We are asked to find the maximum size n such that it can be solved within 1 second, i.e., within 10610^6​ microseconds.
log2(n)=106\log_2(n) = 10^6​​
• Solve for n:
n=2106n = 2^{10^6}​​
• So, n=2106n = 2^{10^6}​​
For Algorithm B:
• The time taken by Algorithm B is n\sqrt{n}​  microseconds.
• We are asked to find the maximum size n such that it can be solved within 1 second, i.e., within 10610^6​ microseconds.
n=106\sqrt{n} = 10^6​​
• Solve for n:
n=(106)2=1012n = (10^6)^2 = 10^{12}​​
So, n=1012n = 10^{12}​.
Final Answer:
The largest sizes n that each algorithm can solve in 1 second are:
• For Algorithm A: 21062^{10^6}​​
• For Algorithm B: 101210^{12}​​

Free Tests

Free
Must Attempt

UGC NET Paper 1 Held on 02 January 2026 Shift 2

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt

UGC NET Paper 1 Held on 06 January 2026 Shift 2

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt

UGC NET Paper 1 Held on 02 January 2026 Shift 2

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
test-prime-package

Access ‘UGC NET Computer Science’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
340k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow