Re: [algogeeks] Duplicate file in all computers in a network

2012-08-23 Thread atul anand
start with N bytes.. because each computer is connected to every other computer transfer 1st byte to computer 1 transfer 2nd byte to computer 2 transfer 3rd byte to computer 3 transfer 4th byte to computer 4 . . . transfer N byte to computer N now computer 2 can open say x port and read

[algogeeks] Re: INTERFACES VS ABSTRACT

2012-08-23 Thread invictus
Java does not implement multiple inheritance. Interfaces are a way to have an Object having multiple behaviors. Abstract class won't give you that facility. Moreover, Interfaces should be used only to define types (Refer Effective Java by Josh Bloch for discussion on Abstract classes vs

[algogeeks] Re: INTERFACES VS ABSTRACT

2012-08-23 Thread kings
Dear sulekha, when u want a default property to get embedded ie u want to force any feature use abstract. when u want an additional feature need to be added used interface. ex: For a car the default things are steering, engine, etc... if u want the car to compulsory to have A/c then add it in

[algogeeks] Re: MS interview

2012-08-23 Thread kings
Dear GC, The efficient data structure in my opinion is Hash Table. 1. For a given word in the dictionary we need to form an anagram dictionary i.e. take a given word sort it which forms the key for the hashtable , then start forming the different anagrams for that word and insert it into the

Re: [algogeeks] Re: INTERFACES VS ABSTRACT

2012-08-23 Thread Amit Tiwari
With an abstract class, the subclass of that inheritance tree only can and should provide the definitions of the methods. With an interface, subclasses of different inheritance tree can also implement the same methods. Interface provides a way to separate out and group common behavior of different

Re: [algogeeks] Re: INTERFACES VS ABSTRACT

2012-08-23 Thread vaibhav shukla
Abstract class are used for Abstraction Interface are used for Polymorphism On Thu, Aug 23, 2012 at 6:06 PM, Amit Tiwari amit.monu...@gmail.com wrote: With an abstract class, the subclass of that inheritance tree only can and should provide the definitions of the methods. With an interface,

Re: [algogeeks] Re: MS interview

2012-08-23 Thread Ashish Goel
yes, that is correct. O(mn) to form multimap and then O(m) to tell all anagram groups Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, Aug 23, 2012 at 5:11 PM, kings dns.bhar...@gmail.com wrote: Dear GC, The efficient data structure in my

Re: [algogeeks] Re: MS interview

2012-08-23 Thread Karthikeyan Muthu
i would suggest using tires data structure, basically a n-nary tree to store the dictionary. Entire algo is as follows: 1) Create a trie http://en.wikipedia.org/wiki/Trie representing the dictionary. 2) create a aux array for the search key. as count [ key[i] ] ++; 3) Start a recursion from the