## Stable Marriage Problem – Gale–Shapley Algorithm – Java

Stable Marriage Given N men and N women and the marriage preference order for each man and woman. Their marriage will be stable when these men and women marry in such a manner so...

Skip to content
# Category: Google Interview

##
Stable Marriage Problem – Gale–Shapley Algorithm – Java

##
Given an array, find three-element sum closest to Zero

##
Number of Intervals in which given value lies

##
Articulation Points OR Cut Vertices in a Graph

##
Print All Paths in Dijkstra’s Shortest Path Algorithm

##
Check if Graph is Bipartite – Adjacency List using Depth-First Search(DFS)

##
Longest substring with at most K unique characters

##
Sort a given stack – Using Recursion

##
Determine the given routing number belong to which bank

##
Check if interval is covered in given coordinates

##
Evaluation of Prefix Expressions (Polish Notation) | Set 2

##
Minimum Boats Required to rescue people

##
Minimum No of operations required to convert a given number to 1 – Integer Replacement Problem.

##
Convert Postfix to Prefix Expression

##
Convert Postfix to Infix Expression

@tutorialhorizon

Stable Marriage Given N men and N women and the marriage preference order for each man and woman. Their marriage will be stable when these men and women marry in such a manner so...

Objective: Given an array of integers, find the sum of any three elements which is closest to zero. The array may contain positive and negative elements. Example: Given Input: [-1, 4, -2, 5, 10,...

Objective: Given a list of intervals with start and end for each interval. You have given a value V, write an algorithm to find the number of intervals in which the value V lies. ...

Objective: Given a graph, write an algorithm to find all the articulation points or cut vertices. Articulation Points: In a graph, a vertex is called an articulation point if removal of that vertex (along...

Objective: Given a graph and a source vertex write an algorithm to find the shortest path from the source vertex to all the vertices and print the paths all well. Example: We strongly recommend reading...

Objective: Given a graph represented by the adjacency List, write a Depth-First Search(DFS) algorithm to check whether the graph is bipartite or not. Earlier we have solved the same problem using Adjacency Matrix (Check...

Objective: Given a string, write an algorithm to find the longest substring with at most K characters. Example: Input: aabbaacdeeeeddded, K = 3 Output: Longest substring with 3 most unique characters is: cdeeeeddded with...

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

Objective: Given the banks and range of routing numbers for each bank. You have given a routing number, write a program to determine which bank it belongs to. Input: Given a list of routing...

Objective: Given 1-D list of coordinates, (x1, x2), (x3, x4), , , ,(xn-1, xn)and interval (a, b). Write an algorithm to determine if interval (a,b) is covered in the list of coordinates. Example: Coordinates...

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

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 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...

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 a Postfix expression, write an algorithm to convert it into Infix expression. Example: Input: Postfix expression: A B + Output: Infix expression- (A + B) Input: Postfix expression: ABC/-AK/L-* Output: Infix expression:...

%d bloggers like this: