|
||
|
|||||||
| Other Cant find a category above, use this one! Core mods not listed above go here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) | |
|
Forum Novice
|
while writing an essay about hash-functions for school i stumbled over some text about hashtables in the wikipedia, and it says:
Quote:
just like Code:
public override int GetHashCode() {
return (int)this.m_Serial;
}
so, what do you think? |
|
|
|
|
|
|
#4 (permalink) |
|
Account Terminated
|
Mobile.Serial would bea HORRIBLE hashcode, since numbers are used again, it would create conflict.
If you wanted to use information from a user's hd ( like the serial of the hd or something like that ) then it ( would require a client to do this ) then you could create a true unique identification number. |
|
|
|
|
|
#5 (permalink) | |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,886
|
Quote:
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
|
#6 (permalink) | |
|
Account Terminated
|
Quote:
Thats at least what I have noticed... |
|
|
|
|
|
|
#7 (permalink) | |
|
Forum Expert
Join Date: Jul 2005
Location: Istanbul/Turkey
Age: 27
Posts: 425
|
Quote:
serials are unique. thats the best way of doing that. but you dont need to override hashcode method in Mobile class unless you use Mobiles as the key values. |
|
|
|
|
|
|
#8 (permalink) | |
|
Forum Expert
Join Date: Jul 2005
Location: Istanbul/Turkey
Age: 27
Posts: 425
|
Quote:
for a specific index, arraylists are faster. (but still both O(1)) but if you are looking for a value (search) hashtables are faster. O(1) vs O(N) |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|