YoVDO

Choosing Between ArrayList and LinkedList in Java - Performance and Memory Considerations

Offered By: Java via YouTube

Tags

Java Courses Data Structures Courses Time Complexity Courses ArrayLists Courses Linked Lists Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Dive into a comprehensive 31-minute tutorial exploring the differences between ArrayList and LinkedList in Java's Collections Framework. Learn how to choose the optimal implementation for your application by benchmarking performance and analyzing memory consumption. Discover the impact of common operations, understand O(n) complexity, and utilize JMH for accurate benchmarking. Explore reading elements from different list positions, investigate pointer chasing, and compare iteration methods. Examine ArrayList's caveats, including insertion, deletion, and resizing. Compare insertion and addition operations between ArrayList and LinkedList, and analyze their memory footprints. Gain insights on optimizing memory usage with trimToSize() and wrap up with a thorough understanding of performance considerations for these essential Java data structures.

Syllabus

Intro
Choosing the best implementation for your use case
Choosing the most common operations for benchmark
Can you apply the On complexity to your use case?
Using JMH to run your benchmarks
Reading elements from the beginning and the end of a list
Reading elements from the middle of a list
Introducing pointer chasing
Benching the impact of pointer chasing on LinkedList
Iterating over a list with an index or an Iterator
Creating an array-based list to speed up your iterations
Wrapping up pointer chasing
ArrayList caveats: insertion, deletion, and resizing
Benching insertion and resizing for ArrayList
Comparing inserting and adding for ArrayList and LinkedList
Comparing the memory consumption of ArrayList and LinkedList
Reducing your memory footprint by using trimToSize
Wrapping up performances and memory consumption
Outro


Taught by

Java

Related Courses

AP Computer Science A: Java Programming Polymorphism and Advanced Data Structures
Purdue University via edX
Learn to Teach Java: ArrayLists and 2D Arrays
University of California, San Diego via Coursera
Applying Data Structures to Manipulate Cleansed UN Data
Coursera Project Network via Coursera
Java Built in Data Structures
Coursera Project Network via Coursera
Introduction to Java and Object-Oriented Programming
University of Pennsylvania via Coursera