Fun Puzzles!-DSA Basics dated 27/03/2023

Hello Everyone!
Try this! :sunglasses:

  1. 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

  2. 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

  3. 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

  4. 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)

  5. 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) A collection of elements with a linear data structure
  2. c) Use the unshift() method
  3. a) Use the push() method
  4. a) O(n)
  5. b) Use the shift() method
  1. b
  2. c
  3. b
  4. b

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.b
2.c
3.b.shift
5.b.

  1. B
  2. A
  3. Donโ€™t Know
  4. Donโ€™t Know
  5. D

1 A collection of elements with a linear data structure
2.a
3.a
5.d

4.a

  1. b
  2. c
  3. a
  4. a
    5.b

1.b
2.c
3.b
4.aoption

  1. a collection of elements with a linear data structure
  2. use the unshift() method
    3.use the push() method
    4.O(n)
    5.use the shift() method

@anithasuthar2000 @vishalpatidar71149 @pk.revan911 @merlingoldasha @mohitkrishnia26 @sagarpatil88896 @surajmadankar3434 @shubham11895 @gauravdhote46 @sumanthkoradala2107

Thank you for your Valuable responses! :partying_face: :partying_face: :sunglasses: