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

#include<stdio.h> #include<conio.h> void main() { char str[10]; int,a,x,sw=0; clrscr(); printf("Enter a string:"); gets(str); for(x=0;x<=a;a++); for(x=0;x<=a;x++) { if(str[x]==str[a-1-x]) { sw=1; } else sw=0; } if(sw==10 printf("The entered string is palindrome:"); else printf("The entered string is not a palindrome:); } getch(); } wht would be the explanation with this written code???

2 Answers  


Display Pattern: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 &#8230;

2 Answers   Mind Tree,


Write a program using one dimensional array that accept five values from the keyboard. Then it should also accept a number to search. This number is to be searched if it among the five input values. If it is found, display the message “Search number is found!” otherwise, display “Search is lost”. Example: Enter 5 numbers: 10 15 20 7 8 Enter number to search: 7 Search number is found!

2 Answers   College School Exams Tests,


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  


how to take time as input in the format (12:02:13) from user so that controls remains between these columns?

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  


Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?

0 Answers  


write a program in c++ to scramble a bmp image file using a scramble key 0x7c and an XOR logic. print out the original image, the scrambled image and the program. Note: the first 24bytes of a bmp file contain the header information of the file.

1 Answers  


what is the difference between int &r and int& r

3 Answers  


Algorithm in O(2n) Presently we can solve in our hypothetical machine problem instances of size 100 in 1 minute using algorithm A, which is a O(2n). We would like to solve instances of size 200 in 1 minute using algorithm A on a new machine. What is the speed of the new machine should be?

2 Answers   ABC, Qatar University,


write a program to sort 'n' elemnts using bubble sort

1 Answers   IBM,


Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.

2 Answers   TCS,


Categories