bitflipper
BAN USER
Comments (3)
Reputation 70
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
Assumption - An employee can report to only 1 manager
It can be implemented as a tree
P = Immediate Parent (Immediate manager)
R = Root of the tree (main boss)
E = Employee to search or add
P searchChildElementInTree(R ,E) - gives manager of the employee
R addEmployeeInTree(R, P, E) - assuming employee can have maximum of 5 immediate subordinates
displayTreeWithRootAs(P) - all nodes under P and its children should be displayed
Comment hidden because of low score. Click to expand.
6
of 6 vote
Swap first and last cells, second and second last cells, and so on till we reach the center
- bitflipper March 19, 2012Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Abstract classes allow default function declaration using abstract keyword and can't be instantiated.
- bitflipper March 19, 2012Normal class can be instantiated as all the methods are defined.
abstract class DBMS
{
abstract <returntype> SELECT(<type> syntax);
abstract <returntype> INSERT(<type> syntax);
}
class ORACLE extends DBMS
{
<returntype> SELECT(<type> syntax){}
<returntype> INSERT(<type> syntax){}
<returntype> SOMETHINGELSE (<type> syntax){}
}