Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Small and medium teams
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
java-code-help
interview
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
interview
/
src
/
com
/
interview
/
tree
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
master
Breadcrumbs
interview
/
src
/
com
/
interview
/
tree
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
AVLTree.java
AVLTree.java
AddGreaterValueNodeToEveryNode.java
AddGreaterValueNodeToEveryNode.java
ArbitaryTreeToChildSumTree.java
ArbitaryTreeToChildSumTree.java
BSTOneChildPreOrderTraversal.java
BSTOneChildPreOrderTraversal.java
BSTSearch.java
BSTSearch.java
BTree.java
BTree.java
BinaryTree.java
BinaryTree.java
BinaryTreeFromParentRepresentation.java
BinaryTreeFromParentRepresentation.java
BinaryTreeMaximumPathSum.java
BinaryTreeMaximumPathSum.java
BinaryTreeToCircularLinkList.java
BinaryTreeToCircularLinkList.java
BinaryTreeToDoubleLinkList.java
BinaryTreeToDoubleLinkList.java
BinaryTreeToSortedLinkList.java
BinaryTreeToSortedLinkList.java
BoundaryTraversal.java
BoundaryTraversal.java
ClosestValueBinaryTree.java
ClosestValueBinaryTree.java
ConnectNodesAtSameLevel.java
ConnectNodesAtSameLevel.java
ConstructAllBinaryTreeFromInorderTraversal.java
ConstructAllBinaryTreeFromInorderTraversal.java
ConstructBSTFromPreOrderArray.java
ConstructBSTFromPreOrderArray.java
ConstructFullTreeFromPreOrderPostOrder.java
ConstructFullTreeFromPreOrderPostOrder.java
ConstructTreeFromInOrderPreOrder.java
ConstructTreeFromInOrderPreOrder.java
ConstructTreeFromLevelOrderInOrder.java
ConstructTreeFromLevelOrderInOrder.java
ConstructTreeFromPreOrderTraversalWith0or2Child.java
ConstructTreeFromPreOrderTraversalWith0or2Child.java
ContructTreeFromInOrderTraversalRootGreaterThanChild.java
ContructTreeFromInOrderTraversalRootGreaterThanChild.java
ContructTreeFromInorderPostOrder.java
ContructTreeFromInorderPostOrder.java
CountNodesCompleteTree.java
CountNodesCompleteTree.java
CountNumberOfSmallerElementOnRight.java
CountNumberOfSmallerElementOnRight.java
CountPathSum.java
CountPathSum.java
CountUnivalueTree.java
CountUnivalueTree.java
CousinNodes.java
CousinNodes.java
DegenerateBinaryTreeToSortedLL.java
DegenerateBinaryTreeToSortedLL.java
DiameterOfTree.java
DiameterOfTree.java
FenwickTree.java
FenwickTree.java
FlattenLinkListToBinaryTreePreorder.java
FlattenLinkListToBinaryTreePreorder.java
HeightBalanced.java
HeightBalanced.java
HuffmanEncoding.java
HuffmanEncoding.java
IdenticalTrees.java
IdenticalTrees.java
InorderSuccessor.java
InorderSuccessor.java
IntervalTree.java
IntervalTree.java
IsBST.java
IsBST.java
IsCompleteBinaryTree.java
IsCompleteBinaryTree.java
IsPreOrderArrayBST.java
IsPreOrderArrayBST.java
KClosestValueInBinaryTree.java
KClosestValueInBinaryTree.java
LargestBSTInBinaryTree.java
LargestBSTInBinaryTree.java
LargestIndependentSetInTree.java
LargestIndependentSetInTree.java
LeavesOfBinaryTree.java
LeavesOfBinaryTree.java
LevelOrderTraversal.java
LevelOrderTraversal.java
LevelOrderTraversalInReverse.java
LevelOrderTraversalInReverse.java
LongestConsecutiveSequence.java
LongestConsecutiveSequence.java
LowestCommonAncestorInBinaryTree.java
LowestCommonAncestorInBinaryTree.java
LowestCommonAncestoryBinarySearchTree.java
LowestCommonAncestoryBinarySearchTree.java
MorrisTraversal.java
MorrisTraversal.java
NextInorderSuccessorIterator.java
NextInorderSuccessorIterator.java
NextInorderSuccessorOfTwoTree.java
NextInorderSuccessorOfTwoTree.java
NodesAtDistanceK.java
NodesAtDistanceK.java
NodesWithNoSibling.java
NodesWithNoSibling.java
PathSum.java
PathSum.java
PopulateInOrderSuccessor.java
PopulateInOrderSuccessor.java
PrintPostOrderFromPreOrderInOrder.java
PrintPostOrderFromPreOrderInOrder.java
PrintTwoBSTInSortedForm.java
PrintTwoBSTInSortedForm.java
RedBlackTree.java
RedBlackTree.java
RootToLeafToSum.java
RootToLeafToSum.java
SameTree.java
SameTree.java
SegmentTree.java
SegmentTree.java
SegmentTreeMinimumRangeQuery.java
SegmentTreeMinimumRangeQuery.java
SerializeDeserializeBinaryTree.java
SerializeDeserializeBinaryTree.java
SinkNegativeToBottom.java
SinkNegativeToBottom.java
SizeOfBinaryTree.java
SizeOfBinaryTree.java
SortedArrayToBST.java
SortedArrayToBST.java
SortedOrderPrintCompleteTreeArray.java
SortedOrderPrintCompleteTreeArray.java
SuccinctTree.java
SuccinctTree.java
SumTree.java
SumTree.java
TreeIsomorphism.java
TreeIsomorphism.java
TreeTraversalInSpiralOrder.java
TreeTraversalInSpiralOrder.java
TreeTraversalLevelByLevel.java
TreeTraversalLevelByLevel.java
TreeTraversals.java
TreeTraversals.java
UpsidedownBinaryTree.java
UpsidedownBinaryTree.java
VertexCoverBinaryTreeDP.java
VertexCoverBinaryTreeDP.java
VerticalOrder.java
VerticalOrder.java
VerticalTreePrinting.java
VerticalTreePrinting.java
View all files
You can’t perform that action at this time.