INITIALIZING SECURE CHANNEL...
CPU MEM NET PING9.2 ms SECSECURED
COFFEE—WEB v4.0 // eu-1
ONLINE 2 847 --:--:--
/english > 17. Algorithms & Complexity
// УРОК 17

Algorithms & Complexity

B2

Algorithms & Complexity Vocabulary

Big O Notation

ComplexityNameExample
O(1)Constant timeHash map lookup
O(log n)LogarithmicBinary search
O(n)LinearIterating an array
O(n log n)Log-linearMerge sort, heap sort
O(n²)QuadraticNested loops, bubble sort
O(2ⁿ)ExponentialBrute-force subset enumeration

Useful Phrases

  • "The naive solution runs in O(n²) but we can optimize it to O(n log n) using a sorted set."
  • "The space complexity is O(n) because we store all elements in the hash map."
  • "This algorithm runs in linear time — it scales well for large inputs."
  • "We can reduce the time complexity from O(n²) to O(n) using a two-pointer approach."
// TERMINAL CHALLENGE

Проверь себя

Q1. What is the time complexity of a binary search?
Q2. Which phrase correctly describes an O(n²) algorithm?
Q3. Complete: 'The naive solution is O(n²), but we can ___ it to O(n log n) with a sorted set.'
Q4. What does 'space complexity' measure?
Q5. What is the two-pointer technique used for?
╔═ GL1TCH v0.1 ═[ПОДКЛЮЧЕНО]═╗ [×]
СОЕДИНЕНИЕ АКТИВНО
запросов:
// сессия #{} начата
>_
[ РАЗРЫВ СВЯЗИ ]
лимит исчерпан...
иду спать... zzZ
хочешь больше? [зарегистрироваться] // +10 запросов в день