mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-13 17:35:14 +08:00
update
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<li>Every element equal to <code>pivot</code> appears <strong>in between</strong> the elements less than and greater than <code>pivot</code>.</li>
|
||||
<li>The <strong>relative order</strong> of the elements less than <code>pivot</code> and the elements greater than <code>pivot</code> is maintained.
|
||||
<ul>
|
||||
<li>More formally, consider every <code>p<sub>i</sub></code>, <code>p<sub>j</sub></code> where <code>p<sub>i</sub></code> is the new position of the <code>i<sup>th</sup></code> element and <code>p<sub>j</sub></code> is the new position of the <code>j<sup>th</sup></code> element. For elements less than <code>pivot</code>, if <code>i < j</code> and <code>nums[i] < pivot</code> and <code>nums[j] < pivot</code>, then <code>p<sub>i</sub> < p<sub>j</sub></code>. Similarly for elements greater than <code>pivot</code>, if <code>i < j</code> and <code>nums[i] > pivot</code> and <code>nums[j] > pivot</code>, then <code>p<sub>i</sub> < p<sub>j</sub></code>.</li>
|
||||
<li>More formally, consider every <code>p<sub>i</sub></code>, <code>p<sub>j</sub></code> where <code>p<sub>i</sub></code> is the new position of the <code>i<sup>th</sup></code> element and <code>p<sub>j</sub></code> is the new position of the <code>j<sup>th</sup></code> element. If <code>i < j</code> and <strong>both</strong> elements are smaller (<em>or larger</em>) than <code>pivot</code>, then <code>p<sub>i</sub> < p<sub>j</sub></code>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user