Toby Cubitt
eb95d01d15
* lisp/emacs-lisp/avl-tree.el: New avl-tree-stack datatype. Add new
...
traversal functions for avl-trees.
(avl-tree--stack): New struct.
(avl-tree-stack-p, avl-tree--stack-repopulate): New funs.
(avl-tree-enter): Add optional `updatefun' arg.
(avl-tree--do-enter): Add optional `updatefun' arg. Change return value.
(avl-tree-delete): Add optional `test' and `nilflag' args.
(avl-tree--do-delete): Add `test' and `nilflag' args. Change return value.
(avl-tree-member): Add optional `nilflag'
(avl-tree-member-p): New function.
(avl-tree-mapc, avl-tree-mapf, avl-tree-mapcar): New functions.
(avl-tree-stack, avl-tree-stack-pop, avl-tree-stack-first)
(avl-tree-stack-empty-p): New functions.
2011-05-27 19:58:29 -03:00
Toby Cubitt
3769ddcf1e
* lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance): Rename from
...
avl-tree--del-balance1 and make it work both ways.
(avl-tree--del-balance2): Remove.
(avl-tree--enter-balance): Rename from avl-tree--enter-balance1 and
make it work both ways.
(avl-tree--enter-balance2): Remove.
(avl-tree--switch-dir, avl-tree--dir-to-sign, avl-tree--sign-to-dir):
New macros.
(avl-tree--mapc, avl-tree-map): Add direction argument.
2011-05-27 16:58:19 -03:00
Glenn Morris
73b0cd5003
Convert consecutive FSF copyright years to ranges.
2011-01-24 20:08:28 -08:00
Glenn Morris
0d9f702fd0
Nuke arch-tags.
2011-01-15 15:16:57 -08:00
Glenn Morris
5df4f04cd3
Add 2011 to FSF/AIST copyright years.
2011-01-02 15:50:46 -08:00
Glenn Morris
114f9c9679
Add 2010 to copyright years.
2010-01-13 00:35:10 -08:00
Glenn Morris
ae940284fa
Add 2009 to copyright years.
2009-01-05 03:18:22 +00:00
Glenn Morris
d6cba7ae45
Switch to recommended form of GPLv3 permissions notice.
2008-05-06 03:21:21 +00:00
Glenn Morris
dcb8ac09ea
Add 2008 to copyright years.
2008-01-09 04:31:51 +00:00
Stefan Monnier
afdd184ca8
Use defstruct rather than macros.
...
Change naming to use "avl-tree--" for internal functions.
2007-08-31 20:15:34 +00:00
Thien-Thi Nguyen
d385b030e7
Commentary and docstring munging; nfc.
2007-08-27 03:09:15 +00:00
Thien-Thi Nguyen
8fa1344249
(avl-tree-del-balance1, avl-tree-del-balance2)
...
(avl-tree-do-del-internal, avl-tree-do-delete)
(avl-tree-enter-balance1, avl-tree-enter-balance2): Use plain `let'.
2007-08-27 02:49:40 +00:00
Thien-Thi Nguyen
5fa11cc28d
Move things around; munge whitespace, indentation; nfc.
2007-08-27 02:40:25 +00:00
Thien-Thi Nguyen
bdf0a82842
Do s/elib-node-/avl-tree-node-/g. Resulting changed macro names:
...
avl-tree-node-left, avl-tree-node-right, avl-tree-node-data,
avl-tree-node-set-left, avl-tree-node-set-right, avl-tree-node-set-data,
avl-tree-node-branch, avl-tree-node-set-branch.
2007-08-27 02:31:23 +00:00
Thien-Thi Nguyen
5afb301bee
Do s/elib-avl-/avl-tree-/g. Resulting changed macro and function names:
...
avl-tree-root, avl-tree-dummyroot, avl-tree-cmpfun, avl-tree-del-balance1,
avl-tree-do-del-internal, avl-tree-del-balance2, avl-tree-do-delete,
avl-tree-enter-balance1, avl-tree-enter-balance2, avl-tree-do-enter,
avl-tree-mapc, avl-tree-do-copy.
2007-08-27 02:22:57 +00:00
Thien-Thi Nguyen
dfd4af17e4
Do s/elib-avl-node/avl-tree-node/g. Resulting changed macro names:
...
avl-tree-node-create, avl-tree-node-balance, avl-tree-node-set-balance.
2007-08-27 02:11:12 +00:00
Thien-Thi Nguyen
329dfe6ae7
(elib-node-create): Delete unused macro.
2007-08-27 02:05:22 +00:00
Thien-Thi Nguyen
923135482e
Reduce nesting: Use modern backquote syntax.
2007-08-27 02:00:45 +00:00
Thien-Thi Nguyen
85718043ee
Do s/avltree/avl-tree/g. Resulting changed function names:
...
avl-tree-create, avl-tree-p, avl-tree-compare-function,
avl-tree-empty, avl-tree-enter, avl-tree-delete, avl-tree-member,
avl-tree-map, avl-tree-first, avl-tree-last, avl-tree-copy,
avl-tree-flatten, avl-tree-size, avl-tree-clear.
Make the symbol used for avl-tree-p `AVL-TREE', as well.
2007-08-27 01:44:37 +00:00
Miles Bader
37840380aa
Add arch tagline
2007-08-27 01:42:03 +00:00
Thien-Thi Nguyen
25e32569d4
Don't require `cl'.
...
(elib-stack-create, elib-stack-push, elib-stack-pop): Delete funcs.
(elib-avl-mapc): Use `nil' for new stack, and `push' and `pop' directly.
2007-08-27 01:35:41 +00:00
Thien-Thi Nguyen
fb5da2db3e
Move provide form to end; nfc.
2007-08-27 01:29:41 +00:00
Thien-Thi Nguyen
b74e26bbe2
Munge comments, whitespace, indentation, hanging parens; nfc.
2007-08-27 01:28:07 +00:00
Thien-Thi Nguyen
1e38b8ffcd
Initial revision, comprising elib-node.el and avltree.el,
...
with minimum modifications for standalone-compilation.
2007-08-27 01:05:44 +00:00