## Minimum Boats Required to rescue people

Objective: Given N people need to be rescued by crossing the river by boat. Each boat can carry a maximum weight of given limit K. Each boat carries at most 2 people at the...

@tutorialhorizon

Objective: Given N people need to be rescued by crossing the river by boat. Each boat can carry a maximum weight of given limit K. Each boat carries at most 2 people at the...

Objective: Given a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. Assume...

Objective: Given a number N, write an algorithm to convert that number to 1. Below are the allowed operations. If N is even, do N = N/2. If N is odd, either do N...

Earlier we had discussed how to evaluate postfix expressions where operands are of single-digit. In this article, we will discuss how to evaluate postfix expressions for any number ( not necessarily single digit.) Postfix...

Postfix notation is a notation for writing arithmetic expressions in which the operands appear before their operators. There are no precedence rules to learn, and parentheses are never needed. Because of this simplicity. Let’s...

Objective: Given an arithmetic expression, write an algorithm to find out whether the expression contains duplicate parenthesis. Duplicate Parenthesis: Two contiguous parentheses with no elements between them can be called as duplicate parenthesis. Example:...

Bipartite Graphs OR Bigraphs is a graph whose vertices can be divided into two independent groups or sets, U and V such that each edge in the graph has one end in set U...

Objective: You are working on a project where QA team has automated set of test cases for the project, but these test cases have to be executed in a specific order since test cases...

Earlier, we have seen Graph and its representations. A graph can be represented using adjacency list and adjacency matrix. So far we have seen the traditional implementation of the Graph. In this article, we...

Objective – Given a graph and an edge, write a program to check if the edge is a bridge. Bridge in Graph: An edge is called a bridge if connects two subgraphs and removing...

Objective: Given a Prefix expression, write an algorithm to convert it into Postfix expression. Example: Input: Prefix expression: + A B Output: Postfix expression: A B + Input: Prefix expression: *-A/BC-/AKL Output: Postfix expression:...

Objective: Given a stack of integers, write an algorithm to sort the stack using a temporary stack. Example: Given Stack: [14, 9, 67, 91, 101, 25] Sorted Stack: [9, 14, 25, 67, 91, 101]...

Objective: Given a Postfix expression, write an algorithm to convert it into prefix expression. Example: Input: Postfix expression: A B + Output: Prefix expression- + A B Input: Postfix expression: ABC/-AK/L-* Output: Infix expression:...

Objective: Given an Integer, write a program to convert it to Roman number. This problem can be stated as “Convert Decimal to Roman String” OR “Convert numeral value to Roman numeral”. Roman Number –...

Objective: Write a recursive function to implement atoi, which converts string to an integer. Rules for converting string to an integer. If the string is null or empty, Integer will be 0. The first...

%d bloggers like this: