15it32c - Data Structures And Algorithms - Multiple Choice Test

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Rmkumar
R
Rmkumar
Community Contributor
Quizzes Created: 2 | Total Attempts: 1,697
| Attempts: 1,461 | Questions: 26
Please wait...
Question 1 / 26
0 %
0/100
Score 0/100
1. Which of the following data structure is linear data structure?

Explanation

Arrays are a linear data structure because they store elements in a contiguous block of memory, where each element can be accessed directly using its index. The elements in an array are stored in a linear manner, one after the other, making it easy to traverse or access elements sequentially. Unlike trees and graphs, which have a hierarchical or non-linear structure, arrays provide a simple and efficient way to store and access data in a linear fashion. Therefore, arrays are the correct answer for this question.

Submit
Please wait...
About This Quiz
15it32c - Data Structures And Algorithms - Multiple Choice Test - Quiz

This quiz, titled '15IT32C - Data Structures and Algorithms', assesses key skills in identifying and understanding different data structures and their operations. It covers topics such as linear... see moreand non-linear structures, traversal, search operations, and optimal uses of arrays and linked lists. see less

2. When new data are to be inserted into a data structure, but there is no available space; this situation is usually called

Explanation

When new data needs to be inserted into a data structure, but there is no available space, this situation is referred to as "overflow." Overflow occurs when the data structure reaches its maximum capacity and cannot accommodate any more data. It is the opposite of underflow, which occurs when data is removed from the structure and there is no remaining data. "Housefull" and "saturated" are not commonly used terms in computer science to describe this situation.

Submit
3. A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a ?

Explanation

A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a Queue. In a queue, the first element to be inserted is the first one to be deleted (First In, First Out - FIFO). This data structure is commonly used in scenarios where elements need to be processed in the order they were added, such as scheduling tasks or handling requests.

Submit
4. Finding the location of the element with a given value is:

Explanation

The correct answer is "Search" because finding the location of an element with a given value involves searching for that value within a data structure or collection. Traversal refers to the process of accessing each element in a data structure, while sorting involves arranging elements in a specific order. "None of the above" is not applicable in this context as searching is the appropriate term for this action.

Submit
5. Which of the following statement(s) about stack data structure is/are NOT correct?

Explanation

The statement "Stack is the FIFO data structure" is not correct. A stack is actually a LIFO (Last-In-First-Out) data structure, meaning that the last element added to the stack is the first one to be removed. In contrast, a FIFO (First-In-First-Out) data structure, such as a queue, follows the principle that the first element added is the first one to be removed.

Submit
6. Which of the following data structure is not linear data structure?

Explanation

The correct answer is "None of above". This means that both arrays and linked lists are linear data structures. Arrays are a contiguous block of memory where elements are stored in a linear manner. Linked lists are a collection of nodes where each node contains a reference to the next node, creating a linear sequence. Therefore, both arrays and linked lists are examples of linear data structures.

Submit
7. Which of the following data structure is not linear data structure?

Explanation

The correct answer is "None of above". This is because both arrays and linked lists are examples of linear data structures. Arrays store elements in contiguous memory locations, allowing for constant-time access to elements. Linked lists, on the other hand, consist of nodes where each node contains a reference to the next node, forming a linear sequence. Therefore, both arrays and linked lists are linear data structures, and the correct answer is that none of the options provided is a non-linear data structure.

Submit
8. The operation of processing each element in the list is known as

Explanation

Traversal refers to the process of accessing each element in a list or data structure. It involves visiting every element one by one, usually in a linear manner, to perform a specific operation or gather information. In this context, the operation of processing each element in the list aligns with the concept of traversal. Sorting, merging, and inserting are different operations that may be performed on a list, but they do not specifically involve processing each element in the list like traversal does.

Submit
9. Which of the following name does not relate to stacks?

Explanation

The term "FIFO" stands for "First-In-First-Out," which is a principle used in queue data structures, not in stacks. Stacks follow the principle of "Last-In-First-Out" (LIFO). The other options, LIFO list, Piles, and Push-down lists, all relate to stacks as they represent different ways of implementing or visualizing stack data structures.

Submit
10. The data structure required to check whether an expression contains balanced parenthesis is?

Explanation

A stack is the appropriate data structure to check whether an expression contains balanced parentheses. This is because a stack follows the Last-In-First-Out (LIFO) principle, which is ideal for checking the order of opening and closing parentheses. When encountering an opening parenthesis, it is pushed onto the stack, and when encountering a closing parenthesis, it is compared to the top element of the stack. If they match, the opening parenthesis is popped from the stack. If at the end of the expression the stack is empty, it means that all parentheses were balanced.

Submit
11. The memory address of the first element of an array is called

Explanation

The memory address of the first element of an array is called the base address. This is because the base address represents the starting point or foundation of the array in memory. It is the reference point from which the array elements are accessed and can be used to calculate the memory address of any other element in the array.

Submit
12. Let the following circular queue can accommodate maximum six elements with the following datafront = 2 rear = 4queue = _______; L, M, N, ___, ___What will happen after ADD O operation takes place?

Explanation

After the ADD O operation takes place, the element O will be added to the circular queue. The front remains the same at 2, and the rear is updated to 5. The queue will now be L, M, N, O, with two empty spaces after O.

Submit
13. In linked list implementation of a queue, where does a new element be inserted? 

Explanation

In a linked list implementation of a queue, a new element is inserted at the tail of the linked list. This is because a queue follows the FIFO (First-In-First-Out) principle, where the element that has been in the queue the longest is the first one to be removed. By inserting the new element at the tail, it ensures that it will be the last element in the queue, and therefore will be the last one to be removed when dequeuing.

Submit
14. Linked lists are best suited

Explanation

Linked lists are best suited for situations where the size of the structure and the data in the structure are constantly changing. This is because linked lists allow for efficient insertion and deletion of elements at any position in the list, without the need to shift or resize the entire structure. The dynamic nature of linked lists makes them ideal for scenarios where the size of the data collection is not fixed and can vary over time.

Submit
15. Arrays are best data structures:

Explanation

Arrays are best data structures for relatively permanent collections of data because arrays provide a fixed-size and contiguous block of memory to store elements. This makes it efficient for accessing elements using their index. Arrays are suitable for situations where the size of the structure and the data in the structure are not constantly changing, as adding or removing elements from an array requires resizing and copying the entire array. Therefore, arrays are not ideal for situations where the structure or data frequently change.

Submit
16. If the MAX_SIZE is the size of the array used in the implementation of circular queue. How is rear manipulated while inserting an element in the queue? 

Explanation

When inserting an element in the queue, the rear is manipulated using the expression rear=(rear+1)%MAX_SIZE. This expression increments the value of rear by 1 and then takes the modulo of MAX_SIZE to ensure that the rear remains within the valid range of indices for the array used in the circular queue implementation. This allows the rear to wrap around to the beginning of the array when it reaches the end, effectively creating a circular behavior.

Submit
17. Each array declaration need not give, implicitly or explicitly, the information about

Explanation

When declaring an array, it is not necessary to provide information about the first data from the set to be stored. The declaration only needs to include the name of the array and the data type of the elements in the array. The first data from the set to be stored can be assigned later when the array is initialized or populated with values.

Submit
18. The elements of an array are stored successively in memory cells because

Explanation

The elements of an array are stored successively in memory cells because by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated. This allows for efficient access to array elements by using the base address and an offset calculation to access any element in the array. Storing elements sequentially in memory also allows for better cache utilization and faster memory access.

Submit
19. A variable P is called pointer if

Explanation

The correct answer is that a variable P is called a pointer if it contains the address of an element in DATA. This means that P is able to store the memory address of a specific element within the DATA. By storing this address, the pointer allows for indirect access to the element itself, making it a valuable tool in programming for manipulating and referencing data.

Submit
20. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?

Explanation

The given expression is in infix form. To convert it to postfix form, we need to rearrange the operators and operands. The conversion follows the rule of placing operators after their operands. The expression in postfix form would be "AB+ CD*E - FG /**".

Submit
21. A circular queue is implemented using an array of size 10. The array index starts with 0, front is 6, and rear is 9. The insertion of next element takes place at the array index.

Explanation

In a circular queue, the front and rear pointers indicate the positions of the first and last elements in the queue respectively. The array index where the insertion of the next element takes place is determined by the value of the rear pointer. Since the rear pointer is at index 9, the next element will be inserted at index 0, as the array is circular and wraps around.

Submit
22. The following C Function takes a singly- linked list of integers as a parameter and rearrangesthe elements of the lists. The function is called with the list containing the integers 1,2,3,4,5,6,7 in the given order. What will be the contents of the list after the function completes execution?struct node{int value;struct node* next;};void rearrange (struct node* list){struct node *p,q;int temp;if (! List || ! list->next) return;p->list; q=list->next;while(q){temp=p->value; p->value=q->value;q->value=temp;p=q->next;q=p?p->next:0;}} 

Explanation

The function rearranges the elements of the linked list by swapping the values of each pair of adjacent nodes. It starts with the first node and swaps its value with the value of the next node. Then it moves to the next pair of nodes and continues swapping their values. This process continues until the end of the list is reached. Therefore, the contents of the list after the function completes execution will be 2, 1, 4, 3, 6, 5, 7.

Submit
23. Consider the following array implementation of stack:#define MAX 10Struct STACK{Int arr [MAX];Int top = -1;}If the array index starts with 0, the maximum value of top which does not cause stack overflow is? 

Explanation

The maximum value of top which does not cause stack overflow is 8 because the array index starts with 0. In this implementation, the top variable represents the index of the top element in the stack. Since the array index starts with 0, the maximum index value that can be used without causing a stack overflow is 9. However, since the initial value of top is -1, we need to add 1 to the maximum index value, resulting in a maximum value of top equal to 8. This ensures that the stack remains within the bounds of the array.

Submit
24. Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?

Explanation

Deleting a node whose location is given is performed more efficiently by a doubly linked list than by a singly linked list. In a doubly linked list, each node contains references to both the previous and next nodes, allowing for easier deletion of a node at a given location. This is because in a singly linked list, to delete a node at a given location, we need to traverse the list from the beginning to find the node before the desired location, which takes more time. However, in a doubly linked list, we can directly access the node at the given location and update the references of the previous and next nodes, making the deletion process faster.

Submit
25. A data structure where elements can be added or removed at either end but not in the middle

Explanation

A deque, also known as a double-ended queue, is a data structure where elements can be added or removed at either end but not in the middle. This means that elements can be inserted or deleted from both the front and the rear of the deque. Linked lists, stacks, and queues also allow for adding and removing elements, but they do not support insertion or deletion from both ends. Therefore, the correct answer is deque.

Submit
26. Which of the following statements about linked list data structure is/are TRUE?

Explanation

The linked list pointers do not provide an efficient way to search an item in the linked list. This is because in a linked list, each node only contains a pointer to the next node in the list, making it necessary to traverse the entire list from the beginning in order to find a specific item. This linear search process can be time-consuming, especially for large lists.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jul 11, 2016
    Quiz Created by
    Rmkumar
Cancel
  • All
    All (26)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which of the following data structure is linear data structure?
When new data are to be inserted into a data structure, but there is...
A linear list of elements in which deletion can be done from one end...
Finding the location of the element with a given value is:
Which of the following statement(s) about stack data structure is/are...
Which of the following data structure is not linear data structure?
Which of the following data structure is not linear data structure?
The operation of processing each element in the list is known as
Which of the following name does not relate to stacks?
The data structure required to check whether an expression contains...
The memory address of the first element of an array is called
Let the following circular queue can accommodate maximum six elements...
In linked list implementation of a queue, where does a new element be...
Linked lists are best suited
Arrays are best data structures:
If the MAX_SIZE is the size of the array used in the implementation of...
Each array declaration need not give, implicitly or explicitly, the...
The elements of an array are stored successively in memory cells...
A variable P is called pointer if
The postfix form of the expression (A+ B)*(C*D- E)*F / G is?
A circular queue is implemented using an array of size 10. The array...
The following C Function takes a singly- linked list of integers as a...
Consider the following array implementation of stack:#define MAX...
Which of the following operations is performed more efficiently by...
A data structure where elements can be added or removed at either end...
Which of the following statements about linked list data structure...
Alert!

Advertisement