LinkedList Flashcards

1
Q

How to import and initialize a Linked List

A

import java.util.LinkedList;

LinkedList<DataType> Name = new LinkedList<>();</DataType>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

O(n)

A

Access, Search, delete value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

O(1)

A

Insert at head and tail

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to add to head/tail and remove from head/tail

A

addFirst(E e)
addLast(E e)
removeFirst()
removeLast()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to get an element at linked list index

A

linkedList.get(i);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly