修复Values 从大到小.

This commit is contained in:
huangsimin 2019-07-18 11:52:58 +08:00
parent 16f40b7016
commit 411533f1a4
4 changed files with 6 additions and 6 deletions

View File

@ -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)
}

View File

@ -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
}

View File

@ -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)
}

View File

@ -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
}