Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 06 · DSA · Clinic: search, trees, graphs and heaps · about 13 min to read

Play it as a journeyTutor comes with a plan

Clinic #12: Search in Rotated Sorted Array

Pattern: Binary Search (twisted) · LC 33

Search in Rotated Sorted Array
Search in Rotated Sorted Array · Open board

Ye drawing ek sorted list dikhata hai jise beech se kaat ke uska pehla tukda peeche jod diya gaya hai, jahan sabse bada number achanak sabse chhote se takrata hai, wahi jagah har step pe dhoondhni hai.

Before you start. Tumhe seedhi sorted list mein binary search karna aata ho: beech ka number dekho, target chhota ya bada, usi hisab se aadhi list phenk do,Clinic #11: Binary Search mein yahi sikhaya gaya. Is clinic mein list seedhi nahi, ghuma diya gaya hai, aur wahi twist us seedhi soch ko todta hai.

Lesson 48 of 96 in DSA

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • Server ka circular log: sorted hai, par shuru beech se hota hai
  • Seedha binary search yahan galat half chunta hai
  • Insight: har mid pe ek tukda hamesha poora sorted bachta hai
  • 1 · Problem + Constraints
  • 2 · Solution Ladder
  • 3 · Trace: nums=[4,5,6,7,0,1,2], target 0
  • 4 · Interview mein pehli baar, raasta
  • 5 · The Tell
  • 6 · Chala ke dekho: sahi wala, < wala bug, aur poora census
  • Retrieval

Terms it explains: LC 33, sorted, daaye, poora sorted, do phere, BEST, 1-pass modified BS, O(log n), Clarify, Chhota example, Key dekho, INSIGHT, Boundaries dhyaan, Code, Edge, "Twisted binary search", LOCAL sorted-ness, Sab equal `[2,2,2]`, har, dono, 34 vs 17 compare, do, aadhe targets pe, non-sorted, Find Peak Element.

Review DSA