Print Page | Close Window

Array access

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=22003
Printed Date: 30 March 2026 at 1:18am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Array access
Posted By: Gullanian
Subject: Array access
Date Posted: 22 November 2006 at 4:05pm
Hi guys, long time no speak, hope you are all well!

I have come accross a difficult problem with one of my programs:

  1. Given the array:
  2.  
  3. Index   ID    Value
  4. 0       12    3498
  5. 1       34    13
  6. 2       50    341
  7. 3       900   928
  8. 4       1022  32
  9. 5       2041  1
  10. ...
  11. 130m   140b  3401
  12.  
  13. Where ID is ordered ascending
  14. Where value is unordered

  15. Where index ranges from 0 to 130 million
  16. Where ID ranges from 0 to 140 billion

  17. Where ID is the product of multiple primes

  18. Best way to find index in array with just the ID given?

Any help with this problem is appreciated!  Speed is what I am after here, over anything else.  Storing each ID in it's coresponding index would create a table of about 6GB, so that's not an option.  Binary search would be good, but maybe a bit slow.  Hashing as well might cause too large a table as well.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net