Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect

0 Answers  


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

0 Answers   Wipro,


how to find out the maximum number out of the three inputs.

6 Answers   ABC, Apple, C3I, HP, TCS,


Write a program to enter 10 number of integer entries into an array n and then odds up all the odd entries. the program then displays the result. plssss answer assss fast asss u can...

1 Answers  


what is virtual constroctor ? give an exam for it?-(parimal dhimmar)

2 Answers  


Faster Computers Suppose you have a computer that requires 1 minute to solve problem instances of size 1000. What instance sizes can be run in 1 minute if you buy a new computer that runs 1000 times faster than the old one, assuming the following time complexities T(n) for our algorithm? (a) T(n) = O(n). (b) T(n) = O(n3). (c) T(n) = O(10n).

1 Answers   Qatar University,


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

0 Answers   HCL,


Given 1 to n random number, find top 10 maximum numbers and explain the time complexity of the algorithm.

1 Answers   IMO, NetApp,


What is the time complexity T(n) of the following program? a) int n, d, i, j; cin >> n; for (d=1; d<=n; d++) for (i=1; i<=d; i++) for (j=1; j<=n; j += n/10) cout << d << " " << i << " " << j << endl; b) void main() { int n, s, t; cin >> n; for (s = 1; s <= n/4; s++) {t = s; while (t >= 1) { cout << s << " " << t << endl; t--; } } } c) void main() { int n, r, s, t; cin >> n; for (r = 2; r <= n; r = r * 2) for (s = 1; s <= n/4; s++) { t = s; while (t >= 1) { cout << s << " " << t << endl; t--; } } }

3 Answers   CTS, IBM, Infosys, Qatar University,


What will be the output- for(i=1;i<=3;i++) { printf("%d",i); continue; i++; }

5 Answers   Impetus,


Write an algorithm that receives a string and reverses it.

2 Answers  


write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation

0 Answers   HCL,


Categories