what is the best algorithm to sort out unique words from a
list of more than 10 million words(1 crore+)?

we need the best technique in the terms of execution time.

Answers were Sorted based on User's Feedback



what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / arpit dhandhania

Quick Sort

Is This Answer Correct ?    34 Yes 8 No

what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / thananjayan

Quick sort is better but we group the words and then used

Is This Answer Correct ?    18 Yes 0 No

what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / dinavardhini.e

Quick sort.

Is This Answer Correct ?    21 Yes 4 No

what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / purushottam

Quick Sort

Is This Answer Correct ?    12 Yes 1 No

what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / rob

They're looking for unique words, so just sorting isn't good enough. Quicksort can still have a worst case runtime of n^2, or 10 million squared operations. We should use mergesort to guarantee O(nlogn) runtime, and then have a for loop to go through the list comparing element[i] with element [i+1], omitting element[i] if it is equal to element [i+1], and otherwise storing it in a new array or printing it to the screen, an O(n) operation. Then the final runtime is O(nlogn + n), ignoring the constant time to insert elements into a new array.

Is This Answer Correct ?    3 Yes 1 No

what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / swati

Merge sort or Heap sort ..b'coz these sorting has optimal
running time i.e O(nlogn)..

Is This Answer Correct ?    3 Yes 1 No

what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / karthickkumar

tree

Is This Answer Correct ?    2 Yes 3 No

what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / sivapriya

sorting is best

Is This Answer Correct ?    2 Yes 4 No

what is the best algorithm to sort out unique words from a list of more than 10 million words(1 cro..

Answer / shabeer

Array is best

Is This Answer Correct ?    4 Yes 17 No

Post New Answer

More C++ Code Interview Questions

main(){int a=5,b 10,c=2, d;a=b c;d=++a=(--c)*2; printf("%d%d%d%d,a,b,c,d; return o;}

1 Answers  


Deriving time complexity of Binary tree and AVL tree, step by step.

4 Answers   NetApp,


write a function -oriented program that generates the Fibonacci, the current numbers of n(as input) and display them (series). In Fibonacci, the current third number is the sum of the previous number.

3 Answers  


readers and writers problem

1 Answers   Cognizant,


#include<iostream.h> //main() //{ class A { friend class B; public: void read(); }; class B { public : int a,b; }; void A::read() { cout<<"welcome"; } main() { A x; B y; y.read(); } In the above program......, as B is a friend of A B can have access to all members,i cant access y.read . could you please tell me the reason and what would i code to execute this program?

2 Answers  






3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...

0 Answers  


Write a function- oriented to convert the input dollar(s) into its equivalent peso. Assume that one dollar is equivalent to 51.60

1 Answers  


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

0 Answers  


Complexity T(n) What is the time complexity T(n) of the following portions of code? For simplicity, you may assume that n is a power of 2. That is, n = 2k for some positive integer k. a) ? for (i = 1; i <= n; i++) { j = n; cout << i << ? ? j << ? ? << endl; } b) ? for (i = 0; i <= n; i += 2) { j = n; cout << i << ? ? j << ? ? << endl; } c) ? for (i = n; i >= 1; i = i/2) { j = n; cout << i << ? ? j << ? ? << endl; } d) for (i = 1; i <= n; i++) { j = n; while (j >= 0) { cout << i << ? ? j << ? ? << endl; j = j - 2; } }

0 Answers   Qatar University,


Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37

0 Answers  


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.

0 Answers   ABC, Guidance Software,


A Binary no. is given, we hav to find it's decimal equivalent.

2 Answers   Microsoft,


Categories