Click here to Skip to main content
15,890,527 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Wheel Factorization to simplify a Sieve of Eratosthenes [modified] Pin
PIEBALDconsult9-Jan-09 11:53
mvePIEBALDconsult9-Jan-09 11:53 
QuestionEfficient Search/Comparison Algorithm Pin
SanchitK20-Nov-08 3:29
SanchitK20-Nov-08 3:29 
AnswerRe: Efficient Search/Comparison Algorithm Pin
Member 419459320-Nov-08 6:17
Member 419459320-Nov-08 6:17 
AnswerRe: Efficient Search/Comparison Algorithm Pin
Alan Balkany20-Nov-08 10:20
Alan Balkany20-Nov-08 10:20 
AnswerRe: Efficient Search/Comparison Algorithm Pin
cmk20-Nov-08 12:59
cmk20-Nov-08 12:59 
GeneralRe: Efficient Search/Comparison Algorithm Pin
Member 419459320-Nov-08 14:18
Member 419459320-Nov-08 14:18 
GeneralRe: Efficient Search/Comparison Algorithm Pin
cmk20-Nov-08 16:21
cmk20-Nov-08 16:21 
GeneralRe: Efficient Search/Comparison Algorithm Pin
Alan Balkany21-Nov-08 3:35
Alan Balkany21-Nov-08 3:35 
Good point. Some other pros and cons: A radix tree would require more memory accesses. But on the other hand, a radix tree would take less memory than a hash table, so would be more likely to fit entirely in a cache.

The hash-value calculation wouldn't necessarily be slow; it would be all integer operations on a key that could be in a single cache line. Also the number of collisions can be reduced in two ways:

1. Randomly-hashed values follow a Poisson distribution, so the expected number of collisions can be calculated for a given hash-table size. The table size can be increased to achieve an acceptable collision rate.

2. Assuming the list of names is fixed, a perfect hash function http://en.wikipedia.org/wiki/Perfect_hash_function[^] can be constructed, which will have no collisions.
GeneralRe: Efficient Search/Comparison Algorithm Pin
supercat921-Nov-08 9:44
supercat921-Nov-08 9:44 
GeneralRe: Efficient Search/Comparison Algorithm Pin
Alan Balkany21-Nov-08 11:35
Alan Balkany21-Nov-08 11:35 
Question[Message Deleted] Pin
De@r17-Nov-08 3:45
De@r17-Nov-08 3:45 
AnswerRe: convert bubble sort to quick sort Pin
73Zeppelin17-Nov-08 5:48
73Zeppelin17-Nov-08 5:48 
QuestionWumpus problem Pin
hockymot2008_200915-Nov-08 3:32
hockymot2008_200915-Nov-08 3:32 
AnswerRe: Wumpus problem Pin
Reynolds Glisner15-Nov-08 13:23
Reynolds Glisner15-Nov-08 13:23 
GeneralRe: Wumpus problem Pin
hockymot2008_200916-Nov-08 4:25
hockymot2008_200916-Nov-08 4:25 
GeneralRe: Wumpus problem Pin
Member 419459316-Nov-08 4:59
Member 419459316-Nov-08 4:59 
GeneralRe: Wumpus problem Pin
Mark Churchill16-Nov-08 13:07
Mark Churchill16-Nov-08 13:07 
AnswerRe: Wumpus problem Pin
73Zeppelin16-Nov-08 6:04
73Zeppelin16-Nov-08 6:04 
Questionhow to convert plural word to singular? Pin
hawkgao012913-Nov-08 23:49
hawkgao012913-Nov-08 23:49 
AnswerRe: how to convert plural word to singular? Pin
73Zeppelin14-Nov-08 0:39
73Zeppelin14-Nov-08 0:39 
GeneralRe: how to convert plural word to singular? Pin
User 171649214-Nov-08 1:13
professionalUser 171649214-Nov-08 1:13 
GeneralRe: how to convert plural word to singular? Pin
73Zeppelin14-Nov-08 2:18
73Zeppelin14-Nov-08 2:18 
AnswerRe: how to convert plural word to singular? Pin
User 171649214-Nov-08 1:39
professionalUser 171649214-Nov-08 1:39 
QuestionTable comparison material Pin
aggressor_us12-Nov-08 13:29
aggressor_us12-Nov-08 13:29 
AnswerRe: Table comparison material Pin
Member 419459315-Nov-08 12:22
Member 419459315-Nov-08 12:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.