Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to Check if a Tree is a BST or Not issue#1236 #1365

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

Kamini8707
Copy link
Contributor

Issue #1236

Description: This pull request adds a function in C to check if a binary tree satisfies the properties of a binary search tree (BST). The function isBST uses a helper isBSTUtil to recursively validate each node, ensuring all nodes in the left subtree are less and all nodes in the right subtree are greater than the current node.

Changes Made:

Implemented isBSTUtil to recursively check the BST properties.
Added isBST function to initialize and call the helper function.
Created a sample test in main to verify functionality.
Testing: The code has been tested with a sample binary tree structure, and it successfully identifies if the tree is a BST.

Copy link
Member

@pankaj-bind pankaj-bind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add more details in Readme.md

@Kamini8707
Copy link
Contributor Author

i have updated it.

@pankaj-bind
Copy link
Member

pankaj-bind commented Oct 29, 2024

You haven't made any changes.

@pankaj-bind pankaj-bind merged commit ffb45c6 into AlgoGenesis:main Oct 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants