Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
CS foundations
/
Sorting and searching
Binary search finds an insertion position in a sorted array in O(log n). Why can the comp…
from Sorting and searching
Node 24
intermediate
1 min
Binary search finds an insertion position in a sorted array in O(log n). Why can the complete insertion still be O(n)?
Later elements may all need to shift to open one array slot.
Binary search compares every array element after locating the position.
Stable sorting requires rebuilding a hash table on every insertion.
Check
Ask AI about this kata
Report an error
previous kata
Review a generated price search
Review AI code
next kata
Spot the bug in response-time ranking
Spot the bug
A new version is available
Reload