Results 1 to 2 of 2
  1. #1
    sanver99 is offline Member
    Join Date
    Jan 2011
    Rep Power

    Default Implementation of Big Dictionary without using data storage in tables


    I need to implemented a big dictionary with around 50000 words in it. But I should not use hash tables to store key and values because it will require me to allocate space for 50k keys and 50k values. I want something like storing the key and value in a text file and updating it or some thing similar. But in this text file case when I am trying to get the value back I will be doing search in the text rather than some kind of hashing (or am I wrong?). Can someone suggest an efficient way of dictionary implementation without allocating huge tables in the code.


  2. #2
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Rep Power


    I think a HashMap would be the best choice. With 50K key/value pairs, if each pair consumes 1K of RAM, you're still only talking about 50 megabytes. 20 years ago that would have been an issue, but on a modern computer, I don't think it's a big worry.

    If after reconsidering the matter, you still don't want to load the whole dictionary into RAM, you probably ought to consider using an existing database with Java support, rather than re-inventing the wheel. Berkeley DB, SQLite or Derby might be good candidates.


Similar Threads

  1. dictionary
    By aizen92 in forum New To Java
    Replies: 49
    Last Post: 01-01-2011, 09:07 AM
  2. Replies: 1
    Last Post: 05-20-2010, 03:27 PM
  3. Matlab data type implementation & speed
    By uzil24 in forum Advanced Java
    Replies: 3
    Last Post: 10-24-2009, 02:00 AM
  4. How to use one form to submit data to 2 tables on mysql
    By kwesiaryee in forum New To Java
    Replies: 2
    Last Post: 10-10-2008, 01:41 PM
  5. Replies: 0
    Last Post: 12-24-2007, 09:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts