Educational Cards

Learn from video content, text, and interactive tasks

Filters
Clear
equals and hashCode contract

The Contract: if a.equals(b) , then a.hashCode() and b.hashCode() must be equal. equals must be...

Intermediate Algorithms and Data Structures
ArrayList vs LinkedList

ArrayList stores elements in an array: get(i) is O(1), inserting/deleting in the middle is O(n) due...

Intermediate Algorithms and Data Structures
Insertion and Deletion at Positions

Inserting after a known node p : the new node takes p.next , and then p.next points to the new...

Intermediate Algorithms and Data Structures
Doubly Linked List

A doubly linked list stores prev and next . This makes insertions and deletions O(1) once the node...

Intermediate Algorithms and Data Structures
Sorted List and compareTo

A sorted list maintains the invariant that consecutive elements are in non-decreasing order with...

Intermediate Algorithms and Data Structures
Singly Linked List and Nodes

In a singly linked list, each node has a value and a reference next to its successor. The list head...

Beginner Algorithms and Data Structures
Iterator over Lists

An iterator encapsulates the current position in the list. hasNext and next traverse node by node...

Beginner Algorithms and Data Structures
ArrayStack in Java

An ArrayStack stores elements in an array and maintains the index top . push writes at top and...

Intermediate Algorithms and Data Structures
Stack: LIFO and Typical Errors

A stack stores elements according to the LIFO principle: the last element added is the first one...

Beginner Algorithms and Data Structures
Euclidean Algorithm and Runtime

The Euclidean algorithm calculates the greatest common divisor (GCD) of a and b. The modulo variant...

Beginner Algorithms and Data Structures
When Stack, When Queue?

Stack and Queue solve different ordering problems. If the most recent element is needed first...

Beginner Algorithms and Data Structures
Queue: FIFO and Capacity

A queue stores elements in a FIFO manner: the first inserted element is the first to leave the...

Beginner Algorithms and Data Structures