1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-18 03:26:45 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

更新国内版力扣题目描述变更

This commit is contained in:
2022-05-02 23:42:43 +08:00
parent 74598d1cf8
commit 7ea03594b3
198 changed files with 11378 additions and 11118 deletions

View File

@@ -1,26 +1,26 @@
<p>Numbers are randomly generated and passed to a method. Write a program to find and maintain the median value as new values are generated.</p>
<p>Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.</p>
<p>For example,</p>
<p>[2,3,4], the median is&nbsp;3</p>
<p>[2,3], the median is (2 + 3) / 2 = 2.5</p>
<p>Design a data structure that supports the following two operations:</p>
<ul>
<li>void addNum(int num) - Add a integer number from the data stream to the data structure.</li>
<li>double findMedian() - Return the median of all elements so far.</li>
</ul>
<p><strong>Example: </strong></p>
<pre>
addNum(1)
addNum(2)
findMedian() -&gt; 1.5
addNum(3)
findMedian() -&gt; 2
</pre>
<p>Numbers are randomly generated and passed to a method. Write a program to find and maintain the median value as new values are generated.</p>
<p>Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.</p>
<p>For example,</p>
<p>[2,3,4], the median is&nbsp;3</p>
<p>[2,3], the median is (2 + 3) / 2 = 2.5</p>
<p>Design a data structure that supports the following two operations:</p>
<ul>