Tag: bfs
Teaching Kids Programming: Videos on Data Structures and Algorithms BFS (Breadth First Search) is one of the most classic algorithms in Computer Science. Given an array of non-negative integers …
Given the root of a binary tree and a node u in the tree, return the nearest node on the same level that is to the right of u, …
There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, …, N-1, and each room may have some keys …
Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that takes an integer …
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make …