Select Page

## Thủ Thuật về Linked list are not suitable for implementing MCQ Mới Nhất

You đang tìm kiếm từ khóa Linked list are not suitable for implementing MCQ được Update vào lúc : 2022-03-09 23:10:26 . Với phương châm chia sẻ Bí kíp về trong nội dung bài viết một cách Chi Tiết 2022. Nếu sau khi Read nội dung bài viết vẫn ko hiểu thì hoàn toàn có thể lại phản hồi ở cuối bài để Ad lý giải và hướng dẫn lại nha.

This section focuses on the “Linked List” of the Data Structure. These Multiple Choice Questions (mcq) should be practiced to improve the Data Structure skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. What does the following function do for a given Linked List with first node as head?

return;

A. Prints all nodes of linked lists B. Prints all nodes of linked list in reverse order C. Prints alternate nodes of Linked List D. Prints alternate nodes in reverse order

Ans : B

Explanation: fun1() prints the given Linked List in reverse manner. For Linked List 1->2->3->4->5, fun1() prints 5->4->3->2->1.

2. A linear collection of data elements where the linear node is given by means of pointer is called?

A. linked list B. node list C. primitive list D. None of these

Ans : A

Explanation: A linear collection of data elements where the linear node is given by means of pointer is called linked list.

3. 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. None of the mentioned

Ans : B

Explanation: To count the number of elements, you have to traverse through the entire list, hence complexity is O(n).

4. What would be the asymptotic time complexity to add a node the end of singly linked list, if the pointer is initially pointing to the head of the list?

A. O(1) B. O(n) C. θ (n) D. θ (1)

Ans : C

Explanation: No Explanation.

5. What is the output of following function for start pointing to first node of following linked list? 1->2->3->4->5->6
void fun(struct node* start)

if(start == NULL)
return;
printf(“%d “, start->data);
if(start->next != NULL )
fun(start->next->next);
printf(“%d “, start->data);

A. 1 4 6 6 4 1 B. 1 3 5 1 3 5 C. 1 2 3 5 D. 1 3 5 5 3 1

Ans : D

Explanation:fun() prints alternate nodes of the given Linked List, first from head to end, and then from end to head. If Linked List has even number of nodes, then skips the last node.

6. What is the functionality of the following piece of code?
public int function(int data)

int var = 0;
while(temp != null)

if(temp.getData() == data)

return var;

var = var+1;
temp = temp.getNext();

return Integer.MIN_VALUE;

A. Find and delete a given element in the list B. Find and return the given element in the list C. Find and return the position of the given element in the list D. Find and insert a new element in the list

Ans : C

Explanation: When temp is equal to data, the position of data is returned.

7. Linked lists are not suitable to for the implementation of?

A. Insertion sort B. Radix sort C. Polynomial manipulation D. Binary search

Ans : D

Explanation: Linked lists are not suitable to for the implementation of Binary search.

8. In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is

A. log 2 n B. n/2 C. log 2 n – 1 D. n

Ans : D

Explanation: In the worst case, the element to be searched has to be compared with all elements of linked list.

9. Which of these is an application of linked lists?

A. To implement file systems B. For separate chaining in hash-tables C. To implement non-binary trees D. All of the mentioned

Ans : D

Explanation: Linked lists can be used to implement all of the above mentioned applications.

10. In circular linked list, insertion of node requires modification of?

A. One pointer B. Two pointer C. Three pointer D. None

Ans : B

Explanation: In circular linked list, insertion of node requires modification of Two pointer.

Also Check :

Discussion

This set of Data Structure Interview Questions and Answers for freshers focuses on “Singly Linked Lists Operations – 2”.

1. What kind of linked list is best to answer questions like “What is the item position n?”
d) Array implementation of linked list

Explanation: Arrays provide random access to elements by providing the index value within square brackets. In the linked list, we need to traverse through each element until we reach the nth position. Time taken to access an element represented in arrays is less than the singly, doubly and circular linked lists. Thus, array implementation is used to access the item the position n.

2. Linked lists are not suitable for the implementation of ___________
a) Insertion sort
c) Polynomial manipulation
d) Binary search

Explanation: It cannot be implemented using linked lists.

3. Linked list is considered as an example of ___________ type of memory allocation.
a) Dynamic
b) Static
c) Compile time
d) Heap

Explanation: As memory is allocated the run time.

4. In Linked List implementation, a node carries information regarding ___________
a) Data
d) Node

Explanation: A linked list is a collection of objects linked together by references from an object to another object. By convention these objects are names as nodes. Linked list consists of nodes where each node contains one or more data fields and a reference(link) to the next node.

5. Linked list data structure offers considerable saving in _____________
a) Computational Time
b) Space Utilization
c) Space Utilization and Computational Time
d) Speed Utilization

Explanation: Linked lists saves both space and time.

Check this: Data Structure Books | Computer Science Books

6. Which of the following points is/are not true about Linked List data structure when it is compared with an array?
a) Arrays have better cache locality that can make them better in terms of performance
b) It is easy to insert and delete elements in Linked List
c) Random access is not allowed in a typical implementation of Linked Lists
d) Access of elements in linked list takes less time than compared to arrays

Explanation: To access an element in a linked list, we need to traverse every element until we reach the desired element. This will take more time than arrays as arrays provide random access to its elements.

7. What does the following function do for a given Linked List with first node as head?

a) Prints all nodes of linked lists
b) Prints all nodes of linked list in reverse order
c) Prints alternate nodes of Linked List
d) Prints alternate nodes in reverse order

Explanation: fun1() prints the given Linked List in reverse manner.

For Linked List 1->2->3->4->5, fun1() prints 5->4->3->2->1.

8. Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
a) Insertion Sort
b) Quick Sort
c) Heap Sort
d) Merge Sort

Explanation: Both Merge sort and Insertion sort can be used for linked lists. The slow random-access performance of a linked list makes other algorithms (such as quicksort) perform poorly, and others (such as heapsort) completely impossible. Since worst case time complexity of Merge Sort is O(nLogn) and Insertion sort is O(n2), merge sort is preferred.

Sanfoundry Global Education & Learning Series – Data Structure.

To practice all areas of Data Structure for Interviews, here is complete set of 1000+ Multiple Choice Questions and Answers.

Get Free Certificate of Merit in Data Structure I
Participate in Data Structure I Certification Contest
Become a Top Ranker in Data Structure I
Take Data Structure I Tests
Chapterwise Practice Tests: Chapter 1,
2,
3,
4,
5,
6,
7,
8,
9,
10 Chapterwise Mock Tests: Chapter 1,
2,
3,
4,
5,
6,
7,
8,
9,
10

Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms.

Subscribe to his không lấy phí Masterclasses Youtube & technical discussions Telegram SanfoundryClasses.

### Video Linked list are not suitable for implementing MCQ ?

Bạn vừa đọc Post Với Một số hướng dẫn một cách rõ ràng hơn về Video Linked list are not suitable for implementing MCQ tiên tiến và phát triển nhất

### Chia Sẻ Link Cập nhật Linked list are not suitable for implementing MCQ miễn phí

Pro đang tìm một số trong những ShareLink Tải Linked list are not suitable for implementing MCQ miễn phí.

#### Hỏi đáp vướng mắc về Linked list are not suitable for implementing MCQ

Nếu sau khi đọc nội dung bài viết Linked list are not suitable for implementing MCQ vẫn chưa hiểu thì hoàn toàn có thể lại Comment ở cuối bài để Ad lý giải và hướng dẫn lại nha