# Graph Theory Problems

#### Plant Trees, Save Life

There are n students in a school. Some of them are friends with each other. You want to make the sch...

#### Traveling Policy of Ajobdesh

In Ajobdesh, there are multiple cities and one of them is considered as the capital city. Obviously,...

Your very close friend, John, also known as the Baba Yaga, is often on various missions to complete ...

#### Identify The Level

Amin and Belal are two friends. Both have good knowledge about graph and tree in data structure part...

#### How Many Ways?

Regular problem solvers starts their journey by solving ad hoc and number theory. After getting the ...

#### COVID-19 Outbreak

COVID-19 outbreak in Atlantis is so bad that the government is forced to lock down the whole country...

#### Sofdor Ali's Black and White Tree

Sofdor Ali loves Computer Science. He prefers hexadecimal number system to decimals, just because it...

#### Chow, Mo

Mo, the jumper has found an extraordinary tree in the woods. He absolutely loves it. He already has ...

#### Kingdom of Code

Kingdom CODE is the most peaceful place in the universe. King NOVOSH and Queen ALMIDA is ruling this...

#### Circuit Breaker

In your free time, you like to design various electrical circuits to give a hard time to your local ...

#### Spanning Tree

There are N nodes in a tree. You can start from any node of that tree and you have to come back to t...

Techboy is appointed as the minister of roads and highway in his country Better-Not-Name-It. Now he ...

#### Scarlet Speedster

The scarlet speedster of Central City, popularly known as the Flash is fighting an epic battle again...

Today is Luke’s birthday. Mr. Phil Dunphy (Luke’s father) has thrown a birthday party for him and de...

#### Yet Another XOR Problem

Given a rooted tree with N nodes where each node has a value, find a pair of nodes (u, v) so that u ...

#### Scary Tree

Recently Alex has been learning about “Tree” data structure. While he was learning, a question popp...

#### Flow on Tree

Mr. Kaboom has recently learned about maximum flow. Now his friend Mr. Taboom gave him this problem....

#### Kingdom - Great Roads of Destiny

Shin wants to be the “Great General of the Heaven”. It is his dream. But becoming a “Great General o...

So after successfully becoming many people’s nightmare, XOR has struck again, this time to haunt you...

#### Act of Random Kindness (Hard)

Sammy and Meera liked adventures a lot. Once in a while they used to set out adventures. This time t...

#### Flyover in Twinland

Rio has become the president of Twinland. Now he wants to develop his country to fulfill his promise...

#### Ghosh vs Datta

About two hundred years ago, a serious dispute evoked between the two neighboring colonies of Khulna...

#### Prime Avoider

Mr. X is a friend of Hafiz bhai. Mr. X loves to play with numbers in his leisure but he hates prime ...

#### Darth Vader and 3PO on a Tree!

Did you watch Star Wars yet? No? You should in your free time. Now back to Darth Vader and 3PO. Dar...

#### Keep Moving

Balurmath is a city which has N interesting tourist spots, which are connected between themselves by...

#### Village Fair 2

There are N houses in a village far away from here. They are numbered from 1 to N. For this problem ...

#### War in the Wizarding World

There is a deadly war going on between two countries (Bitland and Byteland) in the wizarding world. ...

#### A Boring Game

Alice and Bob are playing a game with a tree with n nodes. Alice always plays first, and the two pla...

#### Gold Mines

The city of gridland is a grid with n rows and m columns. The city can be divided into n*m cells. A ...

#### Haunting of Herobrine

Herobrine’s horror stories are known by many, but only a few dares to speak that name out loud, for ...

#### Christmas Tree

Professor Rio has an amazing Christmas tree. Unlike other trees, this Christmas tree has some specia...

#### Reverse The Magic

You are probably familiar with the technique of representing a Tree as an array of integers using Eu...