Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
18
Task/Priority-queue/EchoLisp/priority-queue.echolisp
Normal file
18
Task/Priority-queue/EchoLisp/priority-queue.echolisp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
(lib 'tree)
|
||||
(define tasks (make-bin-tree 3 "Clear drains"))
|
||||
(bin-tree-insert tasks 2 "Tax return")
|
||||
(bin-tree-insert tasks 5 "Make tea")
|
||||
(bin-tree-insert tasks 1 "Solve RC tasks")
|
||||
(bin-tree-insert tasks 4 "Feed 🐡")
|
||||
|
||||
(bin-tree-pop-first tasks) → (1 . "Solve RC tasks")
|
||||
(bin-tree-pop-first tasks) → (2 . "Tax return")
|
||||
(bin-tree-pop-first tasks) → (3 . "Clear drains")
|
||||
(bin-tree-pop-first tasks) → (4 . "Feed 🐡")
|
||||
(bin-tree-pop-first tasks) → (5 . "Make tea")
|
||||
(bin-tree-pop-first tasks) → null
|
||||
|
||||
;; similarly
|
||||
(bin-tree-pop-last tasks) → (5 . "Make tea")
|
||||
(bin-tree-pop-last tasks) → (4 . "Feed 🐡")
|
||||
; etc.
|
||||
Loading…
Add table
Add a link
Reference in a new issue