项目作者: RuslanPrimak

项目描述 :
Implementation algorithm for Binary Tree with deleting items and printing Tree
高级语言: Java
项目地址: git://github.com/RuslanPrimak/BinaryTree.git
创建时间: 2017-03-05T20:05:35Z
项目社区:https://github.com/RuslanPrimak/BinaryTree

开源协议:Apache License 2.0

下载


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
  1. Example output:
  2. Initial tree
  3. 5
  4. ┌──────┴───────┐
  5. 2 7
  6. ┌────┴──┐ ┌────┴──┐
  7. 1 3 6 8
  8. ┌┴─┐ ┌──┴┐ ┌┴─┐ ┌──┴┐
  9. 4 9
  10. ┌┴─┐ ┌┴─┐
  11. After deleted item
  12. 5
  13. ┌─────┴──────┐
  14. 2 8
  15. ┌────┴──┐ ┌──┴──┐
  16. 1 3 6 9
  17. ┌┴─┐ ┌──┴┐ ┌┴─┐ ┌┴─┐
  18. 4
  19. ┌┴─┐
  20. Random tree
  21. 27
  22. ┌──────────────────┴──────────┐
  23. 22 36
  24. ┌──┴──────┐ ┌─────────────────┴┐
  25. 18 26 41
  26. ┌─┴─────┐ ┌┴─┐ ┌──────────────┴──┐
  27. 4 37 60
  28. ┌──┴──┐ ┌┴─┐ ┌────────┴─────┐
  29. 3 12 43 82
  30. ┌┴─┐ ┌┴─┐ ┌───┴─┐ ┌──┴─────┐
  31. 52 65 94
  32. ┌─┴──┐ ┌──┴──┐ ┌┴─┐
  33. 48 63 67
  34. ┌┴─┐ ┌┴─┐ ┌┴─┐