Skip to content

Commit

Permalink
Clean-up code. Add additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zdenek Grof committed Aug 22, 2023
1 parent b5c1428 commit bfa5f6e
Show file tree
Hide file tree
Showing 5 changed files with 459 additions and 301 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# List

An easy-to-use Fortran list (and trees)library
An easy-to-use Fortran list (and binary-search tree) library

## Introduction

This is work in progress.

At the moment, the following modules are provided:

* `dllnode_mod` to work with individual nodes of double-linked list
* `dll_mod` to work with double-linked lists using the Python-like
* `dllnode_mod` to operate with individual nodes of a double-linked list
* `dll_mod` to operate with double-linked lists using the Python-like
methods
* `rbnode_mode` to work with Red-Black trees
* `rbnode_mode` to operate with Red-Black trees

In the future, I intend to move here single linked list and other
containers (trees, etc.).
Expand Down
41 changes: 20 additions & 21 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
### Red-black tree
## Linked-list
- [ ] add user example

- [x] join and split
- [x] optimize join+split process (no reallocations)
- [x] black height
- [x] allow that root is red
- [x] union (with test)
- [ ] insert and delete tests
## Red-black tree

- [ ] tide-up function names, consistent with list names
- [ ] example of simple tree usage
- [ ] add difference and intersection tests
- [ ] add import / export / copy test
- [ ] implement build from unsorted array (import)
- [ ] implement filter operation
- [ ] implement update node operation

#####Set operations
- [ ] tide-up function names, keep consistency with list names
- [ ] add a simple example of using the library
- [ ] example of destructive / nondestructive operations

- [ ] test intersection/difference
- [ ] operations are destructive, show an example how a copy
can be made easily
##### Set operations

- [ ] storing black height at nodes (efficiency of set-ops)
- [ ] maybe overload operators + * - for union, intersection and differenve
- [ ] encapsulation as tree/tree operations?
- [ ] tidy-up code
- [ ] join-based insert / delete ??
- [x] import/export of data to/from an array
- [ ] filter
- [ ] build from unsorted array (import)
- [ ] join-based insert / delete (just for fun)
- [ ] import/export to file (directly or implement save/load of arrays in common_mod)

A tree module with a linear allocator
#### A tree module with a linear allocator
- [ ] test the concept
- [ ] basic implementation and speed comparisons

## Naming methods suggestions
## Other notes

#### Naming methods suggestions

- unlink_root, link_node
- insert(value)
- erase(value)
- erase(iterator)
Expand Down
Loading

0 comments on commit bfa5f6e

Please sign in to comment.