GeeksforGeeks
yesterday at 18:00. Facebook
[ Geeksforgeeks.org Link ]
Given a N X N matrix Mat[N][N] of positive integers. There are only three possible moves from a cell (i, j)

(i+1, j)
(i+1, j-1)
(i+1, j+1)

Starting from any column in row 0, return the largest sum of any of the paths up to row N-1.

Examples:

Input : mat[4][4] = { {4, 2, 3, 4},
{2, 9, 1, 10},
{15, 1, 3, 0},
...
View details ⇨

Maximum path sum that starting with any cell of 0-th row and ending with any cell of (N-1)-th row - GeeksforGeeks

geeksforgeeks.org
GeeksforGeeks
yesterday at 13:11. Facebook
[ Geeksforgeeks.org Link ]
Given an array of distinct n integers. The task is to check whether reversing one sub-array make the array sorted or not. If the array is already sorted or by reversing a subarray once make it sorted, print “Yes”, else print “No”.

Input : arr [] = {1, 2, 5, 4, 3}
Output : Yes
By reversing the subarray {5, 4, 3},
the array will be sorted.

Input : arr [] = { 1, 2,...
View details ⇨

Check if reversing a sub array make the array sorted - GeeksforGeeks

geeksforgeeks.org
GeeksforGeeks
02/24/2017 at 07:38. Facebook
[ Geeksforgeeks.org Link ]
Given N X N matrix filled with 1 , 0 , 2 , 3 . Find whether there is a path possible from source to destination, traversing through blank cells only. You can traverse up, down, right and left.

A value of cell 1 means Source.
A value of cell 2 means Destination.
A value of cell 3 means Blank cell.
A value of cell 4 means Blank Wall.

Note : there is...
View details ⇨

Find whether there is path between two cells in matrix - GeeksforGeeks

geeksforgeeks.org
GeeksforGeeks
02/23/2017 at 17:14. Facebook
[ Geeksforgeeks.org Link ]
Given an array of size N which is initialized with all zeros. We are given many range add queries, which should be applied to this array. We need to print final updated array as our result.
Examples:

N = 6
Arr = [0, 0, 0, 0, 0, 0]
rangeUpdate1 [0, 2], add 100
Arr = [100, 100, 100, 0, 0, 0]
rangeUpdate1 [1, 5], add 100
Arr = [100, 200, 200, 100, 100,...
View details ⇨

Constant time range add operation on an array - GeeksforGeeks

geeksforgeeks.org
GeeksforGeeks
02/23/2017 at 16:18. Facebook
[ Geeksforgeeks.org Link ]
A limit N will be given, we need to find out the count of binary digit numbers which are smaller than N. Binary digit numbers are those numbers which contains only 0 and 1 as their digits as 1, 10, 101 etc are binary digit numbers.

Examples:

Input : N = 200
Output : 7
Count of binary digit number smaller than N is 7,
enumerated below,
1, 10, 11, 110, 101, 100, 111

Count of Binary Digit numbers smaller than N - GeeksforGeeks

geeksforgeeks.org
GeeksforGeeks
02/23/2017 at 14:52. Facebook
[ Geeksforgeeks.org Link ]
GATE CS 2017 solutions and explanations. These answers and solutions are prepared by contributors.

We will soon be sharing solutions and explanations for set 1.

GATE-CS-2017 (Set 2) - GeeksQuiz

quiz.geeksforgeeks.org
GeeksforGeeks
02/23/2017 at 05:30. Facebook
[ Geeksforgeeks.org Link ]
In this post “Top 10 coding problems of important topics with their solutions ” are written. If you are preparing for a coding interview, going through these problems is a must.

Topics :
1. Graph
2. Linked List
3. Dynamic Programming
4. Sorting And Searching
5. Tree / Binary Search Tree
6. Number Theory
7. BIT Manipulation
8. String / Array

Top 10 algorithms in Interview Questions - GeeksforGeeks

geeksforgeeks.org