![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 | |
|
Professional Programmer
|
Linked lists+networking
I've been reading about linked lists quite a bit and understand it's used for storing information in a "chain". I was wondering, if I made a struct for a server I'm programming, then used the struct data to contain usernames, ips, and anything else I would need to keep as user info, would I be able to use a linked list in order to keep "tabs" on all the users and deal with them individually in a sophisticated manner? That includes kicking, muting, whispering, etc. It seems possible to me, because I just learned about linked lists tonight, but I'm not 100% and don't want to go ahead with it and find out it doesn't work. Thanks.
__________________
▄▄▄▄ Quote:
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it. Download Code::Blocks now! ▄▄▄▄ |
|
|
|
|
|
|
#2 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3
![]() |
Linked lists would probably be a poor choice, because the time to access a given index is O(n), where n is the index. So just finding the user you want to deal with could be time consuming in istelf, much less whatever you do with them. A hash table or an array/vector would probably be a better choice, since the lookup time is nearly constant.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|