Exercises - Cracking the Coding Interview

Chapter 4 - Trees and Graphs
  1. Problem 4.1 - Determine whether there is a path from node E to node S in a directed graph
  2. Problem 4.2 - Generate a binary search tree given an array of sorted integers
  3. Problem 4.3 - Generate lists of each depth level's nodes in a given binary tree
  4. Problem 4.4 - Determine whether a binary tree is balanced
  5. Problem 4.5 - Determine whether a binary tree is a binary search tree
  6. Problem 4.6 - Find the successor node to a given node in a binary search tree
  7. Problem 4.7 - Find build order for projects with dependencies
  8. Problem 4.8 - Find the common ancestor of two given nodes in a binary tree


Problem 4.1 - Determine whether there is a path from node E to node S in a directed graph

Back to Top


Problem 4.2 - Generate a binary search tree given an array of sorted integers

Back to Top


Problem 4.3 - Generate lists of each depth level's nodes in a given binary treek

Back to Top


Problem 4.4 - Determine whether a binary tree is balanceds

Back to Top


Problem 4.5 - Determine whether a binary tree is a binary search tree

Back to Top


Problem 4.6 - Find the successor node to a given node in a binary search tree

Back to Top


Problem 4.7 - Find build order for projects with dependencies

Back to Top


Problem 4.8 - Find the common ancestor of two given nodes in a binary tree

Back to Top