Hello Everyone!
Try this! ![:sunglasses: :sunglasses:](https://community.edyoda.com/images/emoji/twitter/sunglasses.png?v=12)
-
What is a linked list?
a) An array
b) A collection of elements with a linear data structure
c) A collection of elements with a hierarchical data structure
d) None of the above
-
How do you add a new element to the beginning of a linked list?
a) Use the push() method
b) Use the shift() method
c) Use the unshift() method
d) Use the pop() method
-
How do you add a new element to the end of a linked list?
a) Use the push() method
b) Use the shift() method
c) Use the unshift() method
d) Use the pop() method
-
What is the time complexity of accessing an element in a linked list?
a) O(n)
b) O(1)
c) O(log n)
d) O(n^2)
-
How do you remove an element from the beginning of a linked list?
a) Use the push() method
b) Use the shift() method
c) Use the unshift() method
d) Use the pop() method
Have a Happy Learning
Thanks & Regards
Teaching Assistant,
Dharshini M.
3 Likes
1.a
2.a
3.dont know
4.dont know
5.d
@sindhiyadevit Thank you for your valuable response.Please refer the correct answers.
- b) A linked list is a collection of elements with a linear data structure, where each element points to the next element in the list through a pointer or reference.
- c) Use the unshift() method to add a new element to the beginning of a linked list.
- a) Use the push() method to add a new element to the end of a linked list.
- b) The time complexity of accessing an element in a linked list is O(1), since it only requires traversing through one node to access the desired element.
- b) Use the shift() method to remove an element from the beginning of a linked list.
1.b option
2.c option
3.a option
4.a option
5.b option
A collection of elements with a linear data structure
Use the unshift() method
Use the push() method
O(n)
use the shift() method
1 A collection of elements with a linear data structure
2.a
3.a
5.d
4.a