File tree 2 files changed +10
-0
lines changed
g0101_0200/s0146_lru_cache
g0201_0300/s0295_find_median_from_data_stream
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -105,4 +105,9 @@ lRUCache.get(4); // return 4
105
105
(set! head new-node)
106
106
(unless tail (set! tail new-node))
107
107
(hash-set! cache key new-node))))))))
108
+
109
+ ;; Your lru-cache% object will be instantiated and called as such:
110
+ ;; (define obj (new lru-cache% [capacity capacity]))
111
+ ;; (define param_1 (send obj get key))
112
+ ;; (send obj put key value)
108
113
```
Original file line number Diff line number Diff line change @@ -75,4 +75,9 @@ Implement the MedianFinder class:
75
75
(if (> (heap-count max-heap) (heap-count min-heap))
76
76
(exact->inexact (heap-min max-heap))
77
77
(/ (+ (heap-min max-heap) (heap-min min-heap)) 2.0)))))
78
+
79
+ ;; Your median-finder% object will be instantiated and called as such:
80
+ ;; (define obj (new median-finder%))
81
+ ;; (send obj add-num num)
82
+ ;; (define param_2 (send obj find-median))
78
83
```
You can’t perform that action at this time.
0 commit comments