Linked List vs Array List - 09 - Performance Comparison

preview_player
Показать описание
In this series of videos Prof. Patterson implements a Doubly-Linked LIst and an Array List in Java. The goal is to demonstrate the way both implementations conform to the abstract interface "List" but have different performance profiles.

This video looks at the different efficiency of the methods that are associated with the List interface based on which implementation is chosen.
Рекомендации по теме
Комментарии
Автор

Thank you sir, great explanation with visuals.

imertkaradayi
Автор

Nice. What would be the time complexity of retrieving an element from an ArrayList based on its value? Is it the same as getting a value from a LinkedList?

keshavchainani
Автор

Tried to confirm your findings and found that you used a custom List implementation to allow you to do a addFirst, addLast, removeFirst and removeLast on the List interface. With my implementation (same as yours apart from the overwritten interface - I use the methods directly) JDK version 6 - 15 they are similar to your findings apart from the size call on the MyLinkedList (last test case). It is not different to the ArrayList implementation. Could you explain why you get such a huge difference - could it be that your custom implementation is doing something different?

anmatr