Skip to content

Prathamesh603/TreeUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TreeUtils - C++ Tree Library

TreeUtils is a C++ library that provides a collection of functions for manipulating and analyzing binary trees. The library includes operations for building trees, performing various tree traversals, checking tree balance, counting leaf nodes, verifying identical trees, and more. Additional functions are being added to enhance its capabilities.

Features:

  • Tree Construction: Functions for building binary trees, including a helper function to build a tree from a level-order traversal.
  • Tree Traversals:
    • In-order Traversal: Visit left subtree, root, right subtree.
    • Pre-order Traversal: Visit root, left subtree, right subtree.
    • Post-order Traversal: Visit left subtree, right subtree, root.
    • Level-order Traversal: Visit nodes level by level (breadth-first).
  • Tree Analysis:
    • Balance Checking: Check if a tree is balanced, i.e., the difference between heights of left and right subtrees is not more than 1.
    • Leaf Counting: Count the number of leaf nodes in a binary tree.
    • Identical Trees: Check if two trees are identical.
    • Sum Tree Check: Determine if a tree is a sum tree, where each node's value is the sum of its children's values.
    • Height Calculation: Compute the height (or depth) of a tree.

Additional Functions (Coming Soon):

  • More tree algorithms and utilities to help with tree-related problems.

How to Use:

  1. Clone the Repository:
    git clone https://github.com/your-username/TreeUtils.git

About

"A C++ library offering functions for manipulating and analyzing binary trees. It includes operations for tree construction, traversals (in-order, pre-order, post-order, level-order), balance checking, leaf counting, verifying identical trees, sum tree check, height calculation, and more. Additional functions are being added.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages