arun
BAN USER
- -1of 1 vote
Answerswrite the test cases for the Swiping Pad ....??
- arun in India| Report Duplicate | Flag | PURGE
Microsoft Developer Program Engineer - 0of 0 votes
AnswersDifference in memory allocation for struct & class and class & object.
- arun in India| Report Duplicate | Flag | PURGE
Microsoft Applications Developer - 3of 3 votes
AnswersPrint a character 1000 times without using loop and recursion.
- arun in India| Report Duplicate | Flag | PURGE
ThoughtWorks Applications Developer - 0of 0 votes
AnswersThere is an interesting game named one person game. It is played via a m*n grids. There is an non-negative integer in each grid. At first your score is 0. You cannot enter a grid with integer 0. You can start and end the game at any grid you want (of course the number in the grid cannot be 0). At each step you can go up, down,left and right to the adjacent grid. The score you can get at last is the sum of the grids on your path. But you can enter each grid at most once.
- arun in United States
The aim of the game is to get your score as high as possible.
Input:
The first line of input is an integer T the number of test cases. The first line of each test case is a single line containing 2 integers m and n which is the number of rows and columns of the grids. Each of next the m lines contains n space-separated integers D indicating the number in the correspoding grid
Output:
For each test case output an integer in a single line which is maximum score you can get at last.
Constraints:
T is less than 7.
D is less than 60001.
m and n are less than 8.
Sample Input:
4
1 1
5911
1 2
10832 0
1 1
0
4 1
0
8955
0
11493
Sample Output:
5911
10832
0
11493| Report Duplicate | Flag | PURGE
VANS Developer Program Engineer - -2of 2 votes
Answersc
- arun in United States| Report Duplicate | Flag | PURGE
Microsoft Developer Program Engineer - 0of 0 votes
Answerstravel the tree vertically like
- arun in India
2
3 4
5 6 7 8
output:5 3 2 6 7 4 8| Report Duplicate | Flag | PURGE
Yatra.com Developer Program Engineer Algorithm
{
struct node* temp=start, *faltu=NULL;
if(temp->ch=='A' || temp->ch=='E' || temp->ch=='I' || temp->ch=='O'|| temp->ch=='U')
{
faltu=temp;
}
while(temp->next)
{
if(temp->next->ch=='A' || temp->next->ch=='E' || temp->next->ch=='I' || temp->next->ch=='O'|| temp->next->ch=='U')
{
if(faltu==NULL)
{
faltu=temp->next;
temp->next=temp->next->next;
faltu->next=start;
start=faltu;
}
else if(faltu->next==temp->next)
{
faltu=temp->next;
temp=temp->next;
}
else
{
struct node* store=temp->next->next;
temp->next->next=faltu->next;
faltu->next=temp->next;
temp->next=store;
}
}
else temp=temp->next;
}
}
in c++
- arun September 09, 2012