Description Submission
Is This a Binary Search Tree?
Description Submission The special case should be considered References https://www.geeksforgeeks.org/a-program-to-check-if-a-binary-tree-is-bst-or-not/
Swap Nodes [Algo]
Description Submission Level-Order Traversal InOrder Traversal
Tree: Huffman Decoding
Description Submission If ‘0’, go left, if ‘1’, go right. If it is a leaf node, get the charater. Background Knowledge Huffman Coding Priority Queue […]
Binary Search Tree : Lowest Common Ancestor
Description Submission
Tree: Level Order Traversal
Submission Submission Using iterator for level order traversal is error-prone Using index is better
Tree : Top View
Description Submission Level Order Traversal vector<pair<Node*, int>> has no iterator, so we can only use index representation
Tree Traversal Summary
Preorder/Inorder/Postorder The order of the left subtree and the right subtree is constant, and there are 3 positions for the root to occupy. The order […]