r/learnprogramming • • Jan 31 '14

Can someone ELI5 linked lists?

Part of my assignment for my online class involves linked lists and we don't really go over them. I looked around online and I'm slightly confused by all the explainations since I'm fairly new to programming. Can someone dumb it down for me?

74 Upvotes

85 comments sorted by

View all comments

Show parent comment

1

u/FantasticFourSkin Jan 31 '14

Would the Big Oh notation be switched for each test? I'm just learning about that too and still trying to understand it.

1

u/subsage Jan 31 '14

I'm not exactly sure what you mean by "switched," but I think you may be correct in what you mean to say. The Big Oh for each is different when it comes to different operations.

I hope I'm not getting ahead here. So when we're looking at data structures, there's usually a reason for why a specific one is used in some situations and others in different situations.

As /u/door_of_doom was hinting at, different data structures are more efficient than others, but there's different ways of being efficient. The biggest factors of efficiency are memory and time (or speed). These can sometimes overlap, but that's for later.

What I think you meant to say with Big Oh is if you'll really get different results from the testing of each data structure. Answer is that yes, you should. You say you're still trying to understand Big Oh, how's that coming along?

1

u/door_of_doom Feb 01 '14

I honestly don't know exactly how the efficiency of each data model is expressed in Big Oh. I just know that I did it back when I was learning about it, and it was crazy to see results that were orders of magnitude different from each other,