Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BinaryTree

Implementation algorithm for Binary Tree with deleting items and printing Tree

This implemetation includes such operates:

  • adding value
  • checking value for existence
  • deleting value
  • printing out tree structure via pseudo graphic

Example output:

Initial tree
              5              
       ┌──────┴───────┐      
       2              7      
  ┌────┴──┐      ┌────┴──┐   
  1       3      6       8   
 ┌┴─┐  ┌──┴┐    ┌┴─┐  ┌──┴┐  
           4              9  
          ┌┴─┐           ┌┴─┐
                             

After deleted item
             5            
       ┌─────┴──────┐     
       2            8     
  ┌────┴──┐      ┌──┴──┐  
  1       3      6     9  
 ┌┴─┐  ┌──┴┐    ┌┴─┐  ┌┴─┐
           4              
          ┌┴─┐            
                          

Random tree
                            27                             
          ┌──────────────────┴──────────┐                  
         22                            36                  
       ┌──┴──────┐    ┌─────────────────┴┐                 
      18        26                      41                 
     ┌─┴─────┐  ┌┴─┐      ┌──────────────┴──┐              
     4                   37                60              
  ┌──┴──┐                ┌┴─┐      ┌────────┴─────┐        
  3    12                         43             82        
 ┌┴─┐  ┌┴─┐                    ┌───┴─┐         ┌──┴─────┐  
                                    52        65       94  
                                   ┌─┴──┐   ┌──┴──┐    ┌┴─┐
                                  48       63    67        
                                  ┌┴─┐     ┌┴─┐  ┌┴─┐      
     
     

About

Implementation algorithm for Binary Tree with deleting items and printing Tree

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages