Written 2:
Few Questions I remembered :
Q1:
char a;
int i = 300;
a = &i;
a++;
*a=2;
printf("%d",i);
Q2:
Imagine you have a special keyboard with the following keys:
A
Ctrl+A
Ctrl+C
Ctrl+V
where CTRL+A, CTRL+C, CTRL+V each acts as one function key for “Select All”, “Copy”, and “Paste” operations respectively.
If you can only press the keyboard for N times (with the above four keys), please write a program to produce maximum numbers of A. If possible, please also print out the sequence of keys.
That is to say, the input parameter is N (No. of keys that you can press), the output is M (No. of As that you can produce).
Q3: Consider a Binary Tree not necessarily BST, Remove all nodes which don’t lie in any path with sum>= k.
Q4: Given an array arrange it in the form a<b>c<d>e<f>g……….
Q5: Given an array of numbers arrange it in the form of a single number such that the concluded number is
the maximum.
e.g. given : 99, 8, 76, 45, 66, 9, 7, 33, 5, 42
O/P : 99987766654233
Sectional Cut-off for O/P and Coding Questions.
Marking was done against the correct approach, not the exact answers.