Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Commit

Permalink
Initial implementation of SortedList.
Browse files Browse the repository at this point in the history
Supports:
Constructor with custom key and less-than functions
add(), shift() and pop() between O(log16 N) and O(log32 N)
ES6 iteration at O(N)
first() and last() at O(1)

Many other functions are either absent or will crash when run. See my pull request for more information.
  • Loading branch information
mcclure committed Nov 5, 2020
1 parent db8573b commit d12afee
Show file tree
Hide file tree
Showing 3 changed files with 934 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/Immutable.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { Seq } from './Seq';
import { OrderedMap } from './OrderedMap';
import { List } from './List';
import { SortedList, isSortedList } from './SortedList';
import { Map } from './Map';
import { Stack } from './Stack';
import { OrderedSet } from './OrderedSet';
Expand Down Expand Up @@ -64,6 +65,7 @@ export default {
Map: Map,
OrderedMap: OrderedMap,
List: List,
SortedList: SortedList,
Stack: Stack,
Set: Set,
OrderedSet: OrderedSet,
Expand All @@ -85,6 +87,7 @@ export default {
isValueObject: isValueObject,
isSeq: isSeq,
isList: isList,
isSortedList: isSortedList,
isMap: isMap,
isOrderedMap: isOrderedMap,
isStack: isStack,
Expand Down Expand Up @@ -119,6 +122,7 @@ export {
Map,
OrderedMap,
List,
SortedList,
Stack,
Set,
OrderedSet,
Expand Down
Loading

0 comments on commit d12afee

Please sign in to comment.