?? ??? ?? ???? ???? ? ???? ?? ?? ??? ???? ??? ?????.
?? ??? ?? ??
?? ??? ?? ????? ???? ?? ???? ? ?? ??? ??? ??? ??? ????? ?? ????. ? ??? ????? ???.
?? ??? ?? ??? ??? ??? ????.:
- ??? ?? ??? ? ????.
- ???? ?? ??? ? ???.
?? ???? ???? ??? ???? ???? ???? ????. ??? ?? ??? ??? ??? ??? ??? ????.
// examples of the pivot 23 positioned correctly in the array: [3, 5, 6, 12, 23, 25, 24, 30] [6, 12, 5, 3, 23, 24, 30, 25] [3, 6, 5, 12, 23, 30, 25, 24]
? ?? ?? ??? 23? ??? ??? ?????.
??? ??? ?? ??
?? ??? ??? ???? ??? ??? ?? ? ??? ???. ?? ?? ??? ??? ?? ??? ??? ?? ?? ??? ?? ?? Quick Sort? ??? 5?? ?? ??? ?? ??? ??? ?? 5??? ???? ??? ?????. ?, ??? ??? 5? ??? ?????. ??.
[10, 4, 15, 6, 23, 40, 1, 17, 7, 8] ??? ?? 10? ????? ??? ?????:
? ????:
- ?? 10? ??? ??? ??? ???, ??? ????? ? ??? ???? ??? ????. Quick Sort? 10? ?? ???? ?? ???? ??? ?????.
- 4? ? ?? ?? ???? Quick Sort? 4? ? ?? ??? ??? ? ?? ??? ???? ??? ?????.
- ??? numberOfStepsToMove? 1? ?????.
?? ??? 2?? ?? 15? 10?? ???. ??? ???? ???? Quick Sort? ?? ?? ???? ?? ??? ?? ??? ?????.
?? ????? ?? 10?? ?? 6???. Quick Sort? ?? ?? 2? ????. ?? ??? ? ?? ?? ??? 4? 6? ?? ??? ???? ?? ?????. .
?? ??? ??? ? ?? ??? ??? ????? 6? 15? ??? ???. ?? ???? numberOfStepsToMove ?? ???? ??? ????.
Quick Sort? ???? ??? ????? ???? ?? ?? ?? ?? numberOfStepsToMove? ????. ?? ??? ??? ??? ???? ? ??? ??? ???? ? ??? ???.
numberOfStepsToMove? 23 ?? 40? ?? ???? ????. ? ? ?? ???? ?? ???? ?? ?? ?? ? ?? ?????.
?? Quick Sort? ??? 6? ? 1? ???? numberOfStepsToMove? 3?? ???? ??? 3? ??? ????.
Quick Sort? ??? ?? ??? ??? ? ????? ?????.
?? ??? ?? ?????? 10?? ?? ??? 5? ??? ?? ?? ?????. ??? ??(10)? ?? ???? ? ??? ??? 5?? ??? ???? ???. ? ?? ??? ????.
???? ??? ???? ???????:
// examples of the pivot 23 positioned correctly in the array: [3, 5, 6, 12, 23, 25, 24, 30] [6, 12, 5, 3, 23, 24, 30, 25] [3, 6, 5, 12, 23, 30, 25, 24]
?? ??? ??? ??? ?? ? ??? ?? ??? ???? Qucik Sort? ??? ? ?? ??? ??? getNumberOfStepsToMove ??? ???? ?? ?? ??? ???? ??? ???????.
const getNumberOfStepsToMove = (arr, start = 0, end = arr.length - 1) => { let numberOfStepsToMove = start; // we're picking the first element in the array as the pivot const pivot = arr[start]; // start checking the next elements to the pivot for (let i = start + 1; i <= end; i++) { // is the current number less than the pivot? if (arr[i] < pivot) { // yes - so w should increase numberOfStepsToMove // or the new index of the pivot numberOfStepsToMove++; // now swap the number at the index of numberOfStepsToMove with the smaller one [arr[i], arr[numberOfStepsToMove]] = [arr[numberOfStepsToMove], arr[i]]; } else { // what if it's greater? // do nothing -- we need to move on to the next number // to check if we have more numbers less that pivot to increase numberOfStepsToMove or not } } // now we know the pivot is at arr[start] and we know that it needs to move numberOfStepsToMove // so we swap the numbers to place the pivot number to its correct position [arr[start], arr[numberOfStepsToMove]] = [ arr[numberOfStepsToMove], arr[start], ]; return numberOfStepsToMove; };
?? ??? ??? ???? ??? ? ?? ?? ??? ????? ??? ??? ???? ??? ?????.
function quickSort(arr, left = 0, right = arr.length - 1) { // pivotIndex the new index of the pivot in in the array // in our array example, at the first call this will be 5, because we are checking 10 as the pivot // on the whole array let pivotIndex = getNumberOfStepsToMove(arr, left, right); }
- ????? ???? ?? ??? ??? ?? ?? ??? ????? ?????.
- ?? ??? ?? ??? ??? 1? ?? 0? ??? ??? ?????.
?? ??? ????? ??? ????? ???? ???.
// examples of the pivot 23 positioned correctly in the array: [3, 5, 6, 12, 23, 25, 24, 30] [6, 12, 5, 3, 23, 24, 30, 25] [3, 6, 5, 12, 23, 30, 25, 24]
? ???? ???? ?? ???? ??? ????? ?? ?? ???? ??? ???? ????? ????.
? ??? ?? ?? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

?? JavaScript ??? ??? ??? ?????? ?? ??? ?? ?? ??? ?? ???? ????. 1. ??? ???? ???? ?? ??? ?? ? ? ???? ??? ??? ?? ? ?? ????? ?????. 2. Angular? ?????? ??? ?? ???? ? ?? ?? ??? ??? ??? ???? ?????. 3. VUE? ???? ?? ??? ???? ?? ?? ??? ?????. ?? ?? ?? ??, ? ??, ???? ???? ? SSR? ???? ??? ??? ??? ???? ? ??? ?????. ???, ??? ??? ??? ????? ????. ??? ??? ??? ??? ?? ????.

?????, JavaScript ???! ?? ? JavaScript ??? ?? ?? ?????! ?? ?? ??? ??? ??? ? ????. Deno?? Oracle? ?? ??, ??? JavaScript ?? ??? ????, Google Chrome ???? ? ??? ??? ???? ?????. ?????! Deno Oracle? "JavaScript"??? ????? Oracle? ?? ??? ??? ??????. Node.js? Deno? ??? ? Ryan Dahl? ??? ?????? ???? ????? JavaScript? ??? ???? Oracle? ????? ???? ?????.

??? JavaScript?? ??? ??? ?????? ?? ???????. ?? ??, ?? ?? ? ??? ??? ?? ????? ????? ?????. 1. ?? ??? ??? ????? ???? ??. ()? ?? ??? ??? ?????. ?. ()? ?? ??? ?? ??? ??? ?? ? ? ????. 2. ?? ??? .catch ()? ???? ?? ??? ??? ?? ??? ??????, ??? ???? ???? ????? ??? ? ????. 3. Promise.all ()? ?? ????? (?? ?? ?? ? ??????? ??), Promise.Race () (? ?? ??? ?? ?) ? Promise.AllSettled () (?? ??? ???? ??)

Cacheapi? ?????? ?? ???? ??? ???? ???, ?? ??? ??? ?? ???? ? ??? ?? ? ???? ??? ??????. 1. ???? ????, ??? ??, ?? ?? ?? ???? ???? ??? ? ????. 2. ??? ?? ?? ??? ?? ? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?????. 4. ??? ???? ?? ?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 5. ?? ???? ??, ??? ??? ? ??? ??, ?? ??? ? ?? ???? ???? ???? ? ?? ?????. 6.?? ??? ?? ?? ?? ??, ???? ?? ? HTTP ?? ????? ?????? ???????.

.map (), .filter () ? .reduce ()? ?? JavaScript ?? ?? ???? ??? ??? ??? ? ? ????. 1) .map ()? ??? ??? ??? ???? ? ??? ???? ? ?????. 2) .filter ()? ???? ??? ????? ? ?????. 3) .reduce ()? ???? ?? ??? ???? ? ?????. ???? ??? ????? ??? ?? ?? ??? ?????.

JavaScript? ??? ??? ?? ??, ? ? ? ?? ???? ???? ??? ??? ?????. 1. ?? ??? ?? ??? ???? ??? ??? ??? ??? ?? WebAPI? ?????. 2. WebAPI? ??????? ??? ?? ? ? ??? ?? ??? (??? ?? ?? ???? ??)? ????. 3. ??? ??? ?? ??? ?? ??? ?????. ?? ??? ??? ????? ??? ??? ?? ? ???? ?????. 4. ???? ?? (? : Promise. 5. ??? ??? ???? ?? ???? ???? ?? ?? ?? ??? ????? ? ??????.
