Category: Difficulty Level

0

Given an array, Print sum of all subsets

Objective: Given an array of numbers, write an algorithm to print all the subsets sum individually.   Example: Given Input: [1, 2] Output: 3 1 2 0 Explanation: subsets are [0], [1], [2], [1, 2]...

0

Determine the given routing number belong to which bank

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

0

Check if interval is covered in given coordinates

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

0

Lexicographically previous permutation With One swap

Objective: Given an array of integers (in particular order or permutation of a set of numbers), write an algorithm to find the lexicographically previous permutation of the given permutation with only one swap.  This...

0

Find all unique combinations of exact K numbers (from 1 to 9 ) with sum to N

Objective: Given two integers N and K. Write an algorithm to find all the combinations of k numbers which sum to N.  Conditions:  All K numbers must be between 1 and 9 and unique....

0

Print all subsets of an array with a sum equal to zero

Objective: Given an array of integers write an algorithm to find all the subsets for which sum is equal to zero. The array contains both positive and negative integers. Example: Given Array: [8, 3,...

0

Maximum number edges to make Acyclic Undirected/Directed Graph

Given- Given V vertices, what is the maximum number of edges can be added to make Acyclic Undirected Graph. Follow up – what is the maximum number of edges that can be added to...

0

Evaluation of Prefix Expressions (Polish Notation) | Set 2

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

0

ZigZag OR Diagonal traversal in 2d array/Matrix using queue

Objective: Given a two-dimensional array or matrix, Write an algorithm to print the given matrix in a zigzag manner or in other words print all the diagonals of the matrix. Example: int [][] grid...

%d bloggers like this: