Skip to main content

Sorting, binary search, two pointers

Samjho ki main sorting algorithms kaise kaam karte hain aur unka cost kya hai, sorted data aur answers par binary search use karo, aur pair aur window problems ko two pointers se ek pass mein solve karo.

Intermediate 1 · LLM builderabout 3 hours5 sections

Seedha jawab

Achhe sorts O(n log n) mein chalte hain. Binary search sorted data mein item O(log n) mein dhoondhta hai, aur two pointers pair aur range problems ko ek pass mein solve karte hain.

Ye kyun zaroori hai

Pehle sort karke phir smartly search karne se kai slow problems fast ho jaate hain. Coding interview ke bahut saare questions mein binary search aur two pointers aate hain, aur databases aur search features inhi ki wajah se fast rehte hain.

Sign up free to read the whole lesson

The rest of this lesson: 5 parts, video lessons, the best course, practice and a quick check. It is free, takes a few seconds and needs no card.

Accounts are for learners aged 18 and over. Under 18? The quick answer and the first part of every lesson stay open: browse lessons by topic.

Data structures and algorithmsIntermediate 1: LLM builderVideo lessonsBinary searchTwo pointersBig-O notation

Track

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.