File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
g0101_0200/s0146_lru_cache
g0201_0300/s0295_find_median_from_data_stream Expand file tree Collapse file tree 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
105105 (set! head new-node)
106106 (unless tail (set! tail new-node))
107107 (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)
108113```
Original file line number Diff line number Diff line change @@ -75,4 +75,9 @@ Implement the MedianFinder class:
7575 (if (> (heap-count max-heap) (heap-count min-heap))
7676 (exact->inexact (heap-min max-heap))
7777 (/ (+ (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))
7883```
You can’t perform that action at this time.
0 commit comments