Skip to content

Commit a11c7fb

Browse files
committed
docs: mark done problem 295
1 parent 72de672 commit a11c7fb

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

src/hard/readme.md

+12
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,15 @@ medianFinder.findMedian(); // return 1.5 (i.e., (1 + 2) / 2)
418418
medianFinder.addNum(3); // arr[1, 2, 3]
419419
medianFinder.findMedian(); // return 2.0
420420
```
421+
422+
## How to Run in main.rs
423+
424+
Put the code below in main.rs and run `cargo run`
425+
426+
```rust
427+
let mut median_finder = leetcode::hard::find_median_from_data_stream::MedianFinder::new();
428+
median_finder.add_num(1);
429+
median_finder.add_num(2);
430+
let result = median_finder.find_median();
431+
println!("result: {:?}", result);
432+
```

src/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@
103103
- [x] [84. Largest rectangle in histogram](../src/hard/largest_rectangle_in_histogram.rs) -> [Problem Description](../src/hard/readme.md#84-largest-rectangle-in-histogram)
104104
- [x] [212. Word search II](../src/hard/word_search_ii.rs) -> [Problem Description](../src/hard/readme.md#212-word-search-ii)
105105
- [x] [239. Sliding window maximum](../src/hard/sliding_window_maximum.rs) -> [Problem Description](../src/hard/readme.md#239-sliding-window-maximum)
106-
- [ ] [295. Find median from data stream](../src/hard/find_median_from_data_stream.rs) -> [Problem Description](../src/hard/readme.md#295-find-median-from-data-stream)
106+
- [x] [295. Find median from data stream](../src/hard/find_median_from_data_stream.rs) -> [Problem Description](../src/hard/readme.md#295-find-median-from-data-stream)

theory/categories/6.heap_priority_queue/readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ A priority queue can be implemented using a heap.
6969
- [x] [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | Medium | [Solution](../../../src/medium/kth_largest_element_in_an_array.rs) | [Problem Description](../../../src/medium/readme.md#215-kth-largest-element-in-an-array)
7070
- [x] [Task Scheduler](https://leetcode.com/problems/task-scheduler/) | Medium | [Solution](../../../src/medium/task_scheduler.rs) | [Problem Description](../../../src/medium/readme.md#621-task-scheduler)
7171
- [x] [Design Twitter](https://leetcode.com/problems/design-twitter/) | Medium | [Solution](../../../src/medium/design_twitter.rs) | [Problem Description](../../../src/medium/readme.md#355-design-twitter)
72-
- [ ] [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | Hard | [Solution](../../../src/hard/find_median_from_data_stream.rs) | [Problem Description](../../../src/hard/readme.md#295-find-median-from-data-stream)
72+
- [x] [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | Hard | [Solution](../../../src/hard/find_median_from_data_stream.rs) | [Problem Description](../../../src/hard/readme.md#295-find-median-from-data-stream)
7373

7474
Category: `Heap / Priority Queue`
7575
Created on: 2023-11-02 21:12
76-
Last modified on: 2023-11-04 00:06
77-
Status: In Progress
76+
Last modified on: 2023-11-04 00:45
77+
Status: Done
7878
Author: [David Bujosa](https://github.com/bujosa)

0 commit comments

Comments
 (0)