Skip to content

Commit e625911

Browse files
[LEET-295] add problem descriptions
1 parent 4899abe commit e625911

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

leetcode-algorithms/src/main/java/com/stevesun/solutions/FindMedianFromDataStream.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@
33
import java.util.*;
44

55
/**
6-
* Created by fishercoder1534 on 10/3/16.
6+
* 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.
7+
8+
Examples:
9+
[2,3,4] , the median is 3
10+
11+
[2,3], the median is (2 + 3) / 2 = 2.5
12+
13+
Design a data structure that supports the following two operations:
14+
15+
void addNum(int num) - Add a integer number from the data stream to the data structure.
16+
double findMedian() - Return the median of all elements so far.
17+
For example:
18+
19+
addNum(1)
20+
addNum(2)
21+
findMedian() -> 1.5
22+
addNum(3)
23+
findMedian() -> 2
724
*/
825
public class FindMedianFromDataStream {
926
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy