Placement Session

29 March 2025

6 May 2023

Graphs and Trees

Definitions and Concepts

What is a Graph?

It is a collection of Vertices and Edges.

What is an Acyclic Graph?

It is a Graph with no cycles.

What is a Connected Graph?

It is a Graph where there exists a Path between all pairs of Vertices.

What is a Tree?

It is an Acyclic and Connected Graph.

Types of Traversals

Depth First Search

Breadth First Search

Problems

  • Height of a tree
     
  • Symmetric tree
     
  • Iterative In-Order traversal of a tree
     
  • Right view of a tree
     
  • Upper bound in a BST

Problems

  • Top view of a tree
     
  • Tree Height where leaves are connected
     
  • Diameter of a binary tree
     
  • Max sum path in a binary tree
     
  • Convert sorted list to BST

Problems

  • Construct binary tree from in-order and pre-order
     
  • Largest region in a grid
     
  • Deadlock detection
     
  • Topological sorting
     
  • Dijkstra's Algorithm

Ask Me Anything

Thank You!

Placement Session (Graphs and Trees) 6 May 2023

By Ankush Khanna

Placement Session (Graphs and Trees) 6 May 2023

  • 209