Your replies indicate a misunderstanding of asymptotic notation.  If
you do several things in a row, to get the asymptotic performance, you
take the worst performer's speed and use that.

For instance, with the hash, you do several things in a row :
Create the hash: O(n)
Fill the hash: O(n)
Detect duplicates: O(n)

The worst performer is O(n), so the total performance is O(n), which
beats O(n log n) asymptotically.

If you do nested loops, to get the asymptotic performance, you multiply
the iteration counts at each nesting level.  The things in my
suggestion are not nested, so this is not the proper method of analysis.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to