BrainTok
ENESIT

Data Structures and Algorithms: Why Faster Computers Can't Save Bad Algorithms

How the way you organize data decides what is fast: Big-O, hash tables, trees, heaps, sorting, graphs, dynamic programming and greedy choices.

Data Structures and Algorithms · 50 questions

Try 3 questions

1. An O(n²) algorithm moves to a computer 1,000 times faster. In the same time, how much larger an input can it handle?

  1. About 100 times larger
  2. About 1,000 times larger
  3. About 32 times larger
Show the answer

Answer: About 32 times larger

Time grows with n squared, so a 1,000-fold speedup only buys the square root of 1,000, roughly 32 times more input.

2. Doubling the input size of an O(n log n) algorithm roughly does what to its running time?

  1. Exactly doubles it, no more
  2. Roughly quadruples it
  3. A bit more than doubles it
Show the answer

Answer: A bit more than doubles it

n doubles and log n grows by just one step, so the time rises slightly more than twofold, far gentler than quadratic growth.

3. What does Big-O notation deliberately ignore?

  1. Constant factors and smaller terms
  2. How the time grows with input size
  3. How the algorithm behaves at worst
Show the answer

Answer: Constant factors and smaller terms

Big-O describes the growth rate for large inputs, so 3n² + 100n and n² are both O(n²).

The whole quiz comes before your apps

BrainTok asks a few questions like these before the apps you choose open, so your screen time turns into learning. For iPhone.

Join the beta