Advertisement

Linked Lists Uses?

Started by February 27, 2001 09:28 AM
1 comment, last by sbrown 23 years, 11 months ago
What are linked lists commonly used for? Are they very efficient?
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
Advertisement
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.

This topic is closed to new replies.

Advertisement