n00b: linked list question
In my application I have a linked list containing object references to all the buttons in the window.
the user can create/destroy buttons and i need to update the list accordingly.
now my question is in my present setup, when a user destroys a button i would have to :
1. traverse through the list to get the refernce of each button
2. check the string of the button to see if it matches to the button that has been destroyed.
3. if it matches, remove that from the list else continue.
now is there any data structure that would allow me to reference the button in the list using the button string as the index to allow me to do a direct search ?
thank you for the help