1) Insert an element in a linked list at the end , given the start pointer.
2) Write a function to Swap pointers .
3) There is a list containing the check_in and checkout time of every person in a
party . The check_in time is in ascending order while the checkout is random .
and so on
Now , give an optimized solution to find at what time the maximum number of
people will be in the party . My solution - O(nlogn) time and O(n) space . He
another O(nlogn) time and O(n) space solution .
and some other questions that I can't recall
1) Base class contains 2 functions and Derived class (with Private Inheritance
from Base) also contains 2 functions (same name as those in Base cass), then he
asked me the effect by changing the Inheritance type and making different
functions virtual like - virtual func in Base then in Derived and then both .
2) Same question appended- A derived class A derived from Derived and Base , now
A a = new A;
Base *b = a;
Derived *d = a;
b = d;
and b = (Base *) d;
then which functions can I call ?
3) Convert a tree into its mirror without using extra memory - O(1) space .
4) If an array is rotated a number of unknown times , then how to find an
element in O(log n)
5) There are 3 sticks placed at right angles to each other and a sphere is
placed between the sticks . Now another sphere is placed in the gap between the
sticks and Larger sphere . Find the radius of smaller sphere in terms of radius
of larger sphere .