Gyuho Lee
ffe90b9ff3
pkg/adt: remove TODO
...
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:02:28 -07:00
xkey
036bd1ab09
pkg/adt: fix interval tree black-height property based on rbtree
...
Author: xkey <xk33430@ly.com>
ref. https://github.com/etcd-io/etcd/pull/10978
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:02:21 -07:00
Gyuho Lee
33e4877b56
pkg/adt: document textbook implementation with pseudo-code
...
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:02:15 -07:00
Gyuho Lee
c25f746f77
pkg/adt: mask test failure, add TODO
...
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:02:07 -07:00
Gyuho Lee
f4341fd35c
pkg/adt: add "IntervalTree.Delete" failure case
...
Described in https://github.com/etcd-io/etcd/issues/10877 .
"black-height" property: Every path from a node to any descendant leaf node must have the same number of black nodes.
Expected
After deleting 11 (requires rebalancing):
[510,511]
/ \
---------- --------------------------
/ \
[383,384] [830,831]
/ \ / \
/ \ / \
[261,262](red) [410,411] [647,648] [899,900](red)
/ \ \ / \
/ \ \ / \
[82,83] [292,293] [815,816](red) [888,889] [972,973]
\ /
\ /
[238,239](red) [953,954](red)
Got
After deleting 11 (requires rebalancing):
[510,511]
/ \
---------- --------------------------
/ \
[82,83] [830,831]
\ / \
\ / \
[383,384] [647,648] [899,900]
/ \ \ / \
/ \ \ / \
[261,262] [410,411] [815,816] [888,889] [972,973]
/ \ /
/ \ /
[238,239] [292,293] [953,954]
This violates "black-height" property.
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:01:58 -07:00
Gyuho Lee
b3152365bb
pkg/adt: test node "11" deletion
...
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:01:51 -07:00
Gyuho Lee
d938435e44
pkg/adt: README "IntervalTree.Delete" test case images
...
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:01:43 -07:00
Gyuho Lee
594e7d6627
pkg/adt: README initial commit
...
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:01:35 -07:00
Gyuho Lee
266214d19e
pkg/adt: add "visitLevel", make "IntervalTree" interface, more tests
...
Make "IntervalTree" an interface to abstract range tree interface
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-09 11:01:16 -07:00
Gyuho Lee
0b37ae05b1
pkg: clean up code format
...
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2019-08-09 11:00:44 -07:00
Anthony Romano
5c7efaa288
adt: Union for interval trees
2017-06-21 14:33:15 -07:00
Hitoshi Mitake
c4a45c5713
auth, adt: introduce a new type BytesAffineComparable
...
It will be useful for avoiding a cost of casting from string to
[]byte. The permission checker is the first user of the type.
2017-04-05 13:17:24 +09:00
Anthony Romano
f67bdc2eed
*: support checking that an interval tree's keys cover an entire interval
2017-04-03 15:38:07 -07:00
Anthony Romano
25e3ce1feb
adt: Visit() interval trees in sorted order and terminate early
...
For all intervals [x, y), Visit will visit intervals in ascending order
sorted by x. Also fixes a bug where Visit would not terminate the search
when requested by the visitor function.
2017-03-23 00:02:29 -07:00
Gyu-Ho Lee
beb58c434c
*: fix minor typos
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-08 16:21:52 -08:00
Nikita Vetoshkin
eae70c9379
adt: fast path Stab in empty interval tree
2016-10-06 22:41:33 +05:00
Anthony Romano
fc7da09d67
*: add missing godoc package descriptions
...
Fixes #4074
2016-05-27 15:15:26 -07:00
Gyu-Ho Lee
8b77de4e99
pkg: update LICENSE header
2016-05-12 20:48:53 -07:00
Gyu-Ho Lee
ae27b991b1
*: add more examples to clientv3, pkg/adt
2016-04-14 23:46:50 -07:00
Gyu-Ho Lee
c09f23c46d
*: clean up bool comparison
2016-04-02 18:27:54 -07:00
Anthony Romano
b539d3a411
test: check formatting for all relevant packages in pkg/
2016-03-30 15:14:24 -07:00
Anthony Romano
c0b06a7a32
pkg/adt: interval tree
2016-02-29 15:20:30 -08:00