In conclusion, while linked lists have their use cases, arrays (or vectors) are often the better choice for performance-critical applications due to their efficiency in memory usage and speed of access.
0:00 why should you avoid linked lists let's go okay here I'd like to to show an example that first was shown to Me by John Bentley of algorithms Fame make a sequence of random integers keeping them in order and so you you you're given the numbers 5142 and it builds up the sequence as you see it there and then you remove them again by giving a set of positions
0:31 of which one you you take out and so the exercise is for which end is it better to use a linked list than a vector okay or an array okay and so for those that don't understand who here doesn't understand the question that was just proposed right here type one in the chat if you don't understand the question that was proposed by the way if you don't love 14p you know type one in the chat okay so it's actually a pretty it's a pretty simple question right uh here let me see if we can exit out of here uh let's go to the X Cali draw this that
1:01 it's a very it's a very interesting question so you could imagine that there exists a world in which there is some large space like this in which you have a bunch of elements right one two three uh four or five all the way up to whatever right all the way up to I don't know 69 420. and then you have in another world something that looks like this where hold on let me get this thing and drop it all the way down to this and you have one and one well guess what one
🔒 The full, searchable transcript is available with Pro.