Problem Solving with Algorithms

반응형

Trees and Graphs

Tree is a special type of graphs, so the two usual techniques used to traverse a graph are also applicable to trees.

We recommend: Binary Tree Inorder Traversal, Populating Next Right Pointers in Each Node and Number of Islands.

Note that some of the tree problems can also be asked in n-ary tree format, so make sure you know what an n-ary tree is.

Note: Although Number of Islands is not a tree problem, it can be represented as a graph and therefore we categorize it as a graph problem.

 

 Binary Tree Inorder Traversal

 

 Binary Tree Zigzag Level Order Traversal

 

 Construct Binary Tree from Preorder and Inorder Traversal

 

 Populating Next Right Pointers in Each Node

 

 Kth Smallest Element in a BST

 

 

 Inorder Successor in BST

 

 Number of Islands

반응형
반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band