Trees, Binary Trees & Tree Traversals in C++: Complete Beginner's Guide
Binary tree in C++: terminology, full vs complete vs perfect trees, building a tree, and inorder, preorder, postorder and level order traversal.
Trees and graphs are where data structures stop being linear. This series starts with tree vocabulary and the four traversals, adds the binary search tree's ordering rule, drills the interview and university exam questions built on both, and ends with depth-first and breadth-first search on general graphs. Every article uses the same example structures, tested C++ code and step-by-step diagrams.
Follow this progressive roadmap from foundational mechanics to advanced implementations.
Terminology, full vs complete vs perfect trees, building a tree, and inorder, preorder, postorder and level order.
The BST property, search, insertion, the three deletion cases, successor, validation and balance.
Height, diameter, LCA, symmetric and balanced checks, building from traversals, serialization.
Kth smallest, LCA in a BST, floor and ceil, recover a BST, BST to linked list, largest BST subtree.
Written, lab and viva practice for CSE students in Bangladesh: traversals, reconstruction, iterative algorithms.
BST construction from a sequence, deletion traces, pseudocode, worst case and viva answers.
A visual beginner's guide to graphs, stacks, queues and the two basic graph traversals.
Side-by-side comparison with shortest paths, cycle detection, connected components and interview questions.
Browse all technical guides and references organized by subject area.
Core concepts and C++ implementations.
Binary tree in C++: terminology, full vs complete vs perfect trees, building a tree, and inorder, preorder, postorder and level order traversal.
Binary search tree in C++: the BST property, search, insert, all three deletion cases with diagrams, successor, validation and complexity, with tested code.
The most common coding interview questions with tested C++.
Tree interview questions from easy to hard: height, diameter, LCA, symmetric, balanced, build from traversals and serialize, with tested C++ solutions.
20 BST interview questions with tested C++: validate BST, kth smallest, LCA, floor and ceil, recover BST, BST to linked list and largest BST subtree.
Written, lab and viva questions with model answers.
Tree questions for university exams in Bangladesh with model answers: traversals, building a tree from traversals, recursive and iterative algorithms, viva.
BST exam questions for CSE students in Bangladesh: build a binary search tree from a sequence, traversals, all three deletion cases, pseudocode, viva answers.
From first principles to a complete comparison.
What is DFS and BFS? A visual beginner's guide to graphs, stacks and queues, with DFS and BFS traced step by step on one graph and simple C++ code.
DFS vs BFS on one graph: stack vs queue, traversal order, O(V + E) time, memory, shortest paths, cycle detection and connected components, with C++ code.
Broaden your knowledge across interconnected computer science domains.
Essential data structures, memory layouts, algorithmic problem solving, and computational complexity.
A 5-part C++ stack series: LIFO basics and std::stack, stacks built on a vector, an array and a linked list, then five classic stack problems.
Master the Queue data structure in C++ from FIFO fundamentals and STL std::queue to custom Array, Vector, and Linked List implementations, famous competitive programming Queue problems, and Queue vs Stack comparisons.
A complete curriculum from modern C++ language fundamentals to memory management, pointers, references, STL internals, and high-performance engineering.