Click here to Skip to main content
15,919,341 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionMatching two arrays Pin
Ratish Philip7-Aug-06 22:09
Ratish Philip7-Aug-06 22:09 
AnswerRe: Matching two arrays Pin
Ingo8-Aug-06 0:30
Ingo8-Aug-06 0:30 
AnswerRe: Matching two arrays Pin
Sebastian Schneider8-Aug-06 5:14
Sebastian Schneider8-Aug-06 5:14 
AnswerRe: Matching two arrays Pin
El Corazon8-Aug-06 6:46
El Corazon8-Aug-06 6:46 
GeneralRe: Matching two arrays Pin
Zac Howland17-Aug-06 7:11
Zac Howland17-Aug-06 7:11 
GeneralRe: Matching two arrays Pin
El Corazon17-Aug-06 15:48
El Corazon17-Aug-06 15:48 
GeneralRe: Matching two arrays Pin
Zac Howland18-Aug-06 3:46
Zac Howland18-Aug-06 3:46 
GeneralRe: Matching two arrays Pin
El Corazon18-Aug-06 4:45
El Corazon18-Aug-06 4:45 
Zac Howland wrote:
You now have 2 elements in each hash, but the lists are obviously not the same. It is possible to get around this problem, but then you decrease the efficiency to the point where another algorithm would be a better option anyway.


That is why I said you can have a different counting method. By counting in a high byte/low-byte format

Hash1: X,X will produce a count of 2 ==00000000 00000010
Hash2: Y,Y will produce a count of 512 ==00000010 00000000

a proper match, one from each, would produce a count of 257 == 00000001 00000001

What I was saying is you can adapt the count to produce a good result, bit math is still faster than sorting. providing a method for adapting to exception is sometimes faster than ignoring a method because it has an exception. In this case because the count is simply an adapted bit operation it is very efficient. A proper Hash algorithm produces a unique result about 98% of the time, so the 2% exception is either adapted by a larger hash-storage destination, or in this case since the count can be adapted easily, by the resulting operation the hash uses.

_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

AnswerRe: Matching two arrays Pin
Samuel.D16-Aug-06 5:06
Samuel.D16-Aug-06 5:06 
AnswerRe: Matching two arrays Pin
Zac Howland17-Aug-06 7:25
Zac Howland17-Aug-06 7:25 
AnswerRe: Matching two arrays [modified] Pin
Ennis Ray Lynch, Jr.17-Aug-06 9:52
Ennis Ray Lynch, Jr.17-Aug-06 9:52 
Questionsnowball effect Pin
OMalleyW7-Aug-06 22:07
OMalleyW7-Aug-06 22:07 
AnswerRe: snowball effect Pin
El Corazon8-Aug-06 6:32
El Corazon8-Aug-06 6:32 
GeneralRe: snowball effect Pin
OMalleyW8-Aug-06 22:41
OMalleyW8-Aug-06 22:41 
QuestionHow much math have you retained/forgotten? Pin
Michael Dunn1-Aug-06 19:54
sitebuilderMichael Dunn1-Aug-06 19:54 
AnswerRe: How much math have you retained/forgotten? Pin
Ingo1-Aug-06 23:03
Ingo1-Aug-06 23:03 
AnswerRe: How much math have you retained/forgotten? Pin
Jeremy Falcon3-Aug-06 15:43
professionalJeremy Falcon3-Aug-06 15:43 
AnswerRe: How much math have you retained/forgotten? Pin
Andy Brummer3-Aug-06 17:13
sitebuilderAndy Brummer3-Aug-06 17:13 
GeneralRe: How much math have you retained/forgotten? Pin
Bassam Abdul-Baki3-Aug-06 18:08
professionalBassam Abdul-Baki3-Aug-06 18:08 
GeneralRe: How much math have you retained/forgotten? Pin
Andy Brummer3-Aug-06 18:34
sitebuilderAndy Brummer3-Aug-06 18:34 
AnswerRe: How much math have you retained/forgotten? Pin
Shog93-Aug-06 18:06
sitebuilderShog93-Aug-06 18:06 
AnswerRe: How much math have you retained/forgotten? Pin
El Corazon7-Aug-06 6:17
El Corazon7-Aug-06 6:17 
AnswerRe: How much math have you retained/forgotten? Pin
Craster8-Aug-06 1:36
Craster8-Aug-06 1:36 
AnswerRe: How much math have you retained/forgotten? Pin
Roger Wright8-Aug-06 17:07
professionalRoger Wright8-Aug-06 17:07 
AnswerRe: How much math have you retained/forgotten? Pin
Ennis Ray Lynch, Jr.17-Aug-06 9:54
Ennis Ray Lynch, Jr.17-Aug-06 9:54 

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.