Skip to content

Implementation algorithm for Binary Tree with deleting items and printing Tree

License

Notifications You must be signed in to change notification settings

RuslanPrimak/BinaryTree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages