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

write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

0 Answers   Jomo Kenyatta University,


PROBLEM #8 The cashier at the counter of a Super Store, Mr. Khazaanchi has the following bundles of rupee cash notes with him: Rs. 1, 2, 5, 10, 50, 100, 500, 1000 A customer comes at his counter with various items that he has shopped. Mr. Khazaanchi totals the item prices and tells the customer his total amount payable. The customer gives Mr. Khazanchi some amount of cash. Find the total number of rupee notes of each denomination (i.e. 1, 2, 5, 10, 50, 100, 500, 1000) Mr. Khazaanchi will have to give to the withdrawer ensuring that the total number of rupee notes are minimum.

1 Answers   AR, ARJ,


Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?

0 Answers   Wipro,


write a program to convert temperature from fa height into celcius and vise versa,use modular programming

0 Answers   Jomo Kenyatta University,


. Remove all the blank spaces between character.Matrix is of 10* 10. eg: INPUT ------------------------------------ | N | A | | V | |T ------------------------------------- | |G | U | |P | -------------------------------------- |T | | | A | | ------------------------------------ OUTPUT: ------------------------------------ | N | A | V | T | | ------------------------------------- |G |U | P | | | -------------------------------------- |T | A | | | | ------------------------------------

2 Answers   Nagarro,






. Write a program using two-dimensional arrays that computes the sum of data in tows and the sum of data in columns of the 3x3 (three by three) array variable n[3][3].

2 Answers   IBM,


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   Nagarro,


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,


write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n

0 Answers   Jomo Kenyatta University,


How to swap two ASCII numbers?

0 Answers  


Display Pattern: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 …

2 Answers   Mind Tree,


what is the use of using for loop as "for(;;)"?

5 Answers   Satyam,


Categories