Trees and GraphsGraph traversal, shortest paths, heaps, and more
Tree traversal algorithms
Common algorithms on how to traverse a tree visiting each node only once.
Determine if a tree is a subtree of a larger binary tree
Use tree traversal algorithms to solve this tree algorithm question.
Binary Search Tree LCA
For this challenge you will attempt to find the lowest common ancestor of a binary search tree.
2906 solutions
Solution
Symmetric Tree
For this challenge you will traverse a binary tree and determine if it is symmetric.
3105 solutions
Solution
Binary Tree LCA
For this challenge you will attempt to find the lowest common ancestor of a binary tree.
1514 solutions
Solution
Tree Constructor
For this challenge you will determine if an array of integer pairs can form a binary tree properly.
24589 solutions
Solution
Max Heap Checker
For this challenge you will determine whether or not a heap is a max heap.
1398 solutions
Solution
Find minimum spanning tree using Prim's algorithm
A popular algorithm for finding a minimum spanning tree which connects all vertices of a graph.
Seating Students
For this challenge you will determine how many different ways students can sit next to each other.
13567 solutions
Solution
Shortest Path
For this challenge you will have to determine the shortest path from one node to an end node.
6053 solutions
Solution
Weighted Path
For this challenge you will have to determine the shortest weighted path from one node to an end node.
981 solutions
Solution
Hamiltonian Path
For this challenge you will determine whether a given set of vertices form a Hamiltonian path on the graph.
1347 solutions
Solution
Vertex Covering
For this challenge you will determine whether a given set of vertices can cover all the edges in the graph.
546 solutions
Solution
Farthest Nodes
For this challenge you will determine what nodes are farthest apart.
2807 solutions
Solution
Bipartite Matching
For this challenge you will be finding the maximum cardinality matching of a bipartite graph.
979 solutions
Solution
City Traffic
For this challenge you will be finding the maximum traffic that will enter a node.
3813 solutions
Solution