@@ -299,7 +299,7 @@ func TestIsFullTree(t *testing.T) {
299299 two .InsertLeft (4 )
300300 two .InsertRight (5 )
301301
302- if ! root .IsFull () {
302+ if ! root .IsFullTree () {
303303 t .Fatal ("tree should be full" )
304304 }
305305}
@@ -318,12 +318,12 @@ func TestIsNotFullTree(t *testing.T) {
318318 two .InsertLeft (4 )
319319 two .InsertRight (5 )
320320
321- if root .IsFull () {
321+ if root .IsFullTree () {
322322 t .Fatal ("tree should not be full" )
323323 }
324324}
325325
326- func TestTreeIsDegenerate (t * testing.T ) {
326+ func TestTreeIsDegenerateTree (t * testing.T ) {
327327 // Our test tree
328328 //
329329 // 1
@@ -339,7 +339,7 @@ func TestTreeIsDegenerate(t *testing.T) {
339339 three := two .InsertRight (3 )
340340 three .InsertLeft (4 )
341341
342- if ! root .IsDegenerate () {
342+ if ! root .IsDegenerateTree () {
343343 t .Fatal ("tree should be degenerate" )
344344 }
345345}
@@ -358,12 +358,12 @@ func TestTreeIsNotDegenerate(t *testing.T) {
358358 two .InsertLeft (4 )
359359 two .InsertRight (5 )
360360
361- if root .IsDegenerate () {
361+ if root .IsDegenerateTree () {
362362 t .Fatal ("tree should not be degenerate" )
363363 }
364364}
365365
366- func TestIsBalanced (t * testing.T ) {
366+ func TestIsBalancedTree (t * testing.T ) {
367367 // Unbalanced tree
368368 //
369369 // 1
@@ -376,7 +376,7 @@ func TestIsBalanced(t *testing.T) {
376376 two := unbalanced_root .InsertLeft (2 )
377377 two .InsertLeft (3 )
378378
379- if unbalanced_root .IsBalanced () {
379+ if unbalanced_root .IsBalancedTree () {
380380 t .Fatal ("tree should not be balanced" )
381381 }
382382
@@ -397,13 +397,13 @@ func TestIsBalanced(t *testing.T) {
397397 four .InsertLeft (6 )
398398 four .InsertRight (7 )
399399
400- if unbalanced_root .IsBalanced () {
400+ if unbalanced_root .IsBalancedTree () {
401401 t .Fatal ("tree should not be balanced" )
402402 }
403403
404404 // A single root node is a balanced tree
405405 leaf := binarytree .NewNode (1 )
406- if ! leaf .IsBalanced () {
406+ if ! leaf .IsBalancedTree () {
407407 t .Fatal ("single leaf node should be balanced" )
408408 }
409409
@@ -420,12 +420,12 @@ func TestIsBalanced(t *testing.T) {
420420 two .InsertLeft (4 )
421421 two .InsertRight (5 )
422422
423- if unbalanced_root .IsBalanced () {
423+ if unbalanced_root .IsBalancedTree () {
424424 t .Fatal ("tree should not be balanced" )
425425 }
426426
427427 // The sub-tree with root node (2) is balanced
428- if ! two .IsBalanced () {
428+ if ! two .IsBalancedTree () {
429429 t .Fatal ("tree with root (2) should be balanced" )
430430 }
431431
@@ -442,7 +442,7 @@ func TestIsBalanced(t *testing.T) {
442442 three .InsertLeft (4 )
443443 three .InsertRight (5 )
444444
445- if ! balanced_root .IsBalanced () {
445+ if ! balanced_root .IsBalancedTree () {
446446 t .Fatal ("tree should be balanced" )
447447 }
448448}
0 commit comments