Linked Lists Uses?
February 27, 2001 09:48 AM
1) everything
animation
storage of those nifty bsp trees and polygons
databases
shit, i cant list them all,that would take a month
2)depends on how you use them
animation
storage of those nifty bsp trees and polygons
databases
shit, i cant list them all,that would take a month
2)depends on how you use them
Just to elaborate on what the AP said, linked lists are efficient for some operations and slow for others:
insertion of new element = fast
deletion of element = fast (unless you have to find that element in the list first)
searching = generally slow
getting the nth element = generally slow
If you want, I could give big O notation for those, but I''m guessing that wouldn''t help you out much. In general, linked lists are very efficient when adding or removing elements to either end. When you start dealing with elements in the ''middle'' of the list, they tend to get quite inefficient because you have to loop through the list each time. Unlike an array, you can''t just index a specific element.
Hope that helps.
insertion of new element = fast
deletion of element = fast (unless you have to find that element in the list first)
searching = generally slow
getting the nth element = generally slow
If you want, I could give big O notation for those, but I''m guessing that wouldn''t help you out much. In general, linked lists are very efficient when adding or removing elements to either end. When you start dealing with elements in the ''middle'' of the list, they tend to get quite inefficient because you have to loop through the list each time. Unlike an array, you can''t just index a specific element.
Hope that helps.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement