
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
... Also depends on the value being searched for. The example value in the above code - 49 - is fairly ideal for the array. Changing it to e.g. 1 means that the ArrayInt.Search() has to do much more work, and becomes slower, on my computer, than the hashtable at only about 25 items in the list.
Slightly more realistic example. Searches for each value in the array, plus a missing element (-1), instead of repeatedly using a fixed value.
On my computer, the hashtable then becomes more efficient at under 20 items, and this would again be weighted further in real life by the periodic need to re-sort the array because of additions.
... Also depends on the value being searched for. The example value in the above code - 49 - is fairly ideal for the array. Changing it to e.g. 1 means that the ArrayInt.Search() has to do much more work, and becomes slower, on my computer, than the hashtable at only about 25 items in the list.
Which hash library are you using? link?
Which hash library are you using? link?
You said "what I'd call a pretty simple operation in other languages." If you know how classes such as C++'s Vector works in other languages, you wouldn't be asking that.