📚 dsaflash.cards
Problems
Log in
Sign up
Home
/
Data Structures
/
Linked Lists
Linked Lists
Question 1 of 5
What is the time complexity of inserting a node at the head of a singly linked list?
A
O(n^2) -- must shift all elements
B
O(1) -- create a new node pointing to the old head
C
O(log n) -- binary search for the position
D
O(n) -- must traverse to find the current head
← Back to categories