This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
hi John, i dont know if there is direct substitute but i guess if we use Hashtable, HashMap etc then we can consider it as "two dim" array, can't we? each key in the hashtable is index of the row. and the value is the one dim array. right? though i don't know how far this would be good to us. more thoughts? regards maulin
Hi John, I think if isolated, it might be meaningless to say this data structure is good and that less good. It depends on what do you want to do with the data structure. Relationship of general purpose data structure: 1.Small amount of data ? 2 : 3 2.Amount of data predicatable ? 4 : 6 3.Searching and insertion must be very fast ? 9 : 5 4.Search speed more important than insertion speed? 7 : 8 5.Key distribution guaranteed random? 10 : 11 6.Linked list 7.Ordered Array 8.Unordered array 9.Hash Table 10.Binary Search Tree 11.Balanced Tree
Relationship of external storage choice: 1. Speed important ? 2 : 4 2. Speed critical ? 3 : 5 3. Extra storage available ? 6 : 7 4. Sequential search 5. B-tree 6. External hashing 7. Indexed files Concerning hash table, a hash table is based on an array. The range of key value is usually greater than the size of the array. A key value is hashed to an array index by a hash function. It�s not exactly like a two dimensional array but not necessarily better than a two dimensional array. Depends on what you want Once you make your decision of what data structure to use, you can almost always invoke some worked packages to deal with it( I think most probably they would be in the Collection package in Java SDK ) or if you have much time, you can do all the low level constructions by yourself, algorithms available via google Hope that could be of help.
Regards, Ellen [ January 17, 2003: Message edited by: Ellen Fu ]
Java does not support n-dimensional arrays in the strict sense, but rather arrays of arrays (of arrays, etc.). A "true" n-dimensional array would enforce a single scalar for each dimension. That is, a 3 x 5 array would be a three-element array, where each element has 5 elements in the sub-array. Java does not enforce this behavior.
Make visible what, without you, might perhaps never have been seen. - Robert Bresson
Joined: Aug 05, 2001
Thanks. But I guess I can still use a notation like: A Can I?