LinkedList Flashcards

1
Q

Time complexity

A

Insert first / last - O (1) ( doubly linked list)
Insert - O (n) ( single linked list)
Insert/delete any position- O(n)
Search - O(n)

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

Reverse

A
  • Using stack
  • Recursively ( call stack)
  • In place
How well did you know this?
1
Not at all
2
3
4
5
Perfectly