diff --git a/priority_queue/priority_queue_test.go b/priority_queue/priority_queue_test.go index e3f3eb8..dd8abd3 100644 --- a/priority_queue/priority_queue_test.go +++ b/priority_queue/priority_queue_test.go @@ -165,7 +165,7 @@ func TestQueueRemove(t *testing.T) { content += spew.Sprint(pq.Values()) } - if content != "[1 4 10 53 78 90][1 4 53 78 90][1 4 78 90][1 4 90][1 4][4][]" { + if content != "[90 78 53 10 4 1][90 78 53 4 1][90 78 4 1][90 4 1][4 1][4][]" { t.Error(content) } } @@ -183,7 +183,7 @@ func TestQueueRemoveIndex(t *testing.T) { content += spew.Sprint(pq.Values()) } - if content != "[1 4 10 32 53 78][1 4 10 32 53][1 4 10 32][1 4 10][1 4][1][]" { + if content != "[78 53 32 10 4 1][53 32 10 4 1][32 10 4 1][10 4 1][4 1][1][]" { t.Error(content) } diff --git a/priority_queue/vbt.go b/priority_queue/vbt.go index 13ace44..0a116df 100644 --- a/priority_queue/vbt.go +++ b/priority_queue/vbt.go @@ -249,7 +249,7 @@ func (tree *vbTree) Values() []interface{} { tree.Traversal(func(v interface{}) bool { result = append(result, v) return true - }, LDR) + }, RDL) return result } diff --git a/priority_queuekey/priority_queuekey_test.go b/priority_queuekey/priority_queuekey_test.go index 1429da5..8a242b5 100644 --- a/priority_queuekey/priority_queuekey_test.go +++ b/priority_queuekey/priority_queuekey_test.go @@ -165,7 +165,7 @@ func TestQueueRemove(t *testing.T) { content += spew.Sprint(pq.Values()) } - if content != "[1 4 10 53 78 90][1 4 53 78 90][1 4 78 90][1 4 90][1 4][4][]" { + if content != "[90 78 53 10 4 1][90 78 53 4 1][90 78 4 1][90 4 1][4 1][4][]" { t.Error(content) } } @@ -183,7 +183,7 @@ func TestQueueRemoveIndex(t *testing.T) { content += spew.Sprint(pq.Values()) } - if content != "[1 4 10 32 53 78][1 4 10 32 53][1 4 10 32][1 4 10][1 4][1][]" { + if content != "[78 53 32 10 4 1][53 32 10 4 1][32 10 4 1][10 4 1][4 1][1][]" { t.Error(content) } diff --git a/priority_queuekey/vbt.go b/priority_queuekey/vbt.go index d2a0bdc..802be1c 100644 --- a/priority_queuekey/vbt.go +++ b/priority_queuekey/vbt.go @@ -249,7 +249,7 @@ func (tree *vbTree) Values() []interface{} { tree.Traversal(func(k, v interface{}) bool { result = append(result, v) return true - }, LDR) + }, RDL) return result }