- Computer Science Engineering (CSE)
- Data Structures (DS)
- Linear Data Structures - List
- What is the time complexity to count the...

Q. |
## What is the time complexity to count the number of elements in the linked list? |

A. | O(1) |

B. | O(n) |

C. | O(logn) |

D. | O(n2) |

Answer» B. O(n) |

View all MCQs in:
Data Structures (DS)

- What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?
- What differentiates a circular linked list from a normal linked list?
- What is the worst case time complexity of inserting a node in a doubly linked list?
- What is the time complexity of searching for an element in a circular linked list?
- What would be the asymptotic time complexity to insert an element at the front of the linked list (head is known)?
- What would be the asymptotic time complexity to find an element in the linked list?
- What would be the asymptotic time complexity to insert an element at the second position in the linked list?
- The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can be used?
- What is the space complexity for deleting a linked list?
- An array consists of n elements. We want to create a heap using the elements. The time complexity of building a heap will be in order of

Login to Continue

It will take less than 2 minutes

Report MCQ