package cll
Mutable circular doubly linked list
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.1.0.tar.gz
md5=6e8da977fb231fd2edbfdfd3c4d1dd6f
sha512=7b24535331e07f7e1734d0db826344efba271b23a0e8322f722694c1b862fea0d9b965796bac32ee31c414f791771ac64d6c30b3f31b1e8e8dbcaaa6034697c1
doc/index.html
cll
A mutable circular linked list.
Designed for O(1)
insertion and removal, O(n)
traversal, and close to O(1)
search using a backing hashtable.
API Documentation
Cll
A mutable circular linked list.
Installation
Install with opam
$ opam install cll
Install with dune
cll
can be added as a dependency to a dune
file
(executable
(name foo)
(libraries cll))
Install from source
# if dune is not installed
$ opam install dune
# clone the github repo
$ git clone https://github.com/jamsidedown/ocaml-cll.git
$ cd ocaml-cll
# build with dune
$ dune build
# install to the current opam switch
$ opam install .
Usage
To be run in the ocaml toplevel
let cll = Cll.init [ 1; 2; 3; 4; 5; 6 ];;
Cll.head cll;;
(* int option = Some 1 *)
Cll.length cll;;
(* int = 6 *)
Cll.next cll;;
Cll.head cll;;
(* int option = Some 2 *)
Cll.prev cll;;
Cll.prev cll;;
Cll.head cll;;
(* int option = Some 6 *)
Cll.add cll 7;;
Cll.head cll;;
(* int option = Some 7 *)
Cll.pop cll;;
(* int option = Some 7 *)
Cll.head cll;;
(* int option = Some 1 *)
Cll.find cll 4;;
(* bool = true *)
Cll.head cll;;
(* int option = Some 4 *)
Cll.to_list cll;;
(* int list = [4; 5; 6; 1; 2; 3] *)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page