सभी उदाहरण

उदाहरण

Python में क्विक सॉर्ट, एक-एक स्वैप करके

सात नंबर एक पिवट के आसपास सॉर्ट होते हैं: हर तुलना और हर स्वैप उसे करने वाली Python लाइन के बगल में, फिर ग्रोथ चार्ट पर इस रन की 10 तुलनाएं।

यह वीडियो एल्गोरिदम विज़ुअल्स स्किल से बना है।

  • 1:05
  • एल्गोरिदम विज़ुअल्स
  • Charon की आवाज़ में
  • अंग्रेज़ी

प्रॉम्प्ट से बना

Quick sort on 8, 3, 6, 1, 9, 2, 5, step by step in Python

वीडियो की ट्रांसक्रिप्ट

How can you sort these numbers without repeatedly finding the smallest?

These 7 numbers need sorting. Through i, values stay at most the pivot. Orange marks executing code; green means done.

Line 8 picks pivot 5. Line 11 leaves 8 right because it exceeds 5.

3 belongs left. Which number will it swap with?

3 swaps with 8; 1 and 2 also move left because neither exceeds 5.

5 lands between the sides, permanently placed.

Recursion partitions the left around 2; single numbers need no sorting.

8 separates 6 and 9; the pivot rule now holds everywhere. Worst-case work is quadratic.

The chart marks 10 comparisons for 7 numbers; average work grows as n log n.

Partition, then sort each side: that's how you order the numbers.

और उदाहरण

आपका टॉपिक, करीब एक मिनट में बनकर तैयार।

आपके पहले 2 वीडियो फ़्री हैं, हर वीडियो 1 मिनट तक का, वॉटरमार्क के साथ। कार्ड की ज़रूरत नहीं। पूरा प्रोडक्ट, हर आवाज़ और हर स्टाइल समेत।