FREE Bachelor of Computer Engineering Data Structure Questions and Answers

0%

The term "linear list" refers to a collection of elements where deletions may only be made from one end (front) and insertions can only be made from the other end (rear).

Correct! Wrong!

Queue is a linear list of elements where deletion occurs on the front side and insertion occurs on the back side. The most recent piece entered will be deleted first in the stack.

The action of eliminating a stack element is known as .

Correct! Wrong!

The pop operation is used to remove elements from the stack. The pop action eliminates the last entered element, which is the topmost element in the stack.

In Java, how do you create an array?

Correct! Wrong!

In contrast to int arr[] = new int[3];, which instantiates an array, note that int arr[]; is a declaration.

Another name for circular queue is

Correct! Wrong!

Ring Buffer is another name for Circular Queue. A circular data structure known as a circular queue connects the last position to the first position in a linear fashion. It takes the shape of a ring.

What real-world situations from the list below would you identify with a stack data structure?

Correct! Wrong!

Last In First Out (LIFO) is the policy used by the stack. A queue is formed by people standing in a row, a pile of chairs stacked one on top of the other, and a priority queue can be used to describe a service that is based on priority. First in, first out is the policy for Tatkal ticket purchases. The booking page will open up to those who hit the button first.

How can an array be initialized in C?

Correct! Wrong!

The syntax for initializing an array in C is as follows.

How long does it take to count all the elements in the linked list?

Correct! Wrong!

Because the complete list must be traversed in order to count the number of members, complexity is O (n).

It is known as ________ in a stack when a user attempts to remove an element from an empty stack.

Correct! Wrong!

Underflow happens when a user pops a value from an empty stack. When the user pushes while the stack is full, overflow happens. To free up memory that has been taken up by items that are no longer in use, garbage collection is employed.

Which of the following statements about the use of an array is false?

Correct! Wrong!

Two steps can be used to access an array's elements. Add this value to the base address after first multiplying the data type's size by the designated location. Since both of these operations may be completed in constant time, it is quicker to access components at a specific index or position.

If you add one element to a stack that already has five elements and has a size of 5, the stack will become .

Correct! Wrong!

Pushing one more element causes the stack, which already has five elements, to overflow. As a result, the computer's unsaved work is lost and memory and code are overwritten.

Which of the following notions uses arrays the most?

Correct! Wrong!

Since array elements are stored in memory as continuous blocks, it is likely that every reference to a specific memory place will also refer to surrounding locations. This makes accessing array elements faster.

The action of adding a stack member is known as .

Correct! Wrong!

Users can add pieces to the stack using the push method. Overflow may occur if the stack is completely loaded and a push operation is attempted.

How long does it take to insert at the end of a dynamic array?

Correct! Wrong!

The complexity of a dynamic array changes according to whether or not the array is full. The element is simply stored at the end of the array if you attempt to insert into an empty one; this takes O(1) time. If you attempt to insert an element into an array that is already full, you will first need to allocate an array that is twice as large as the existing array, copy all the elements into it, and then insert the new element. This takes O(n) time.

What is the name of a linear collection of data pieces where the linear node is indicated by a pointer?

Correct! Wrong!

Each node in a linked list has its own data as well as the address of the node after it. Pointers are used to connect these nodes. Node lists are objects made up of a list of each node in a document that is included in a particular chosen set of nodes.

What is a double linked list that uses little memory?

Correct! Wrong!

Only one pointer is needed to navigate a memory-efficient doubly linked list back and forth. Pointer difference is the foundation of the implementation. The front and rear pointer addresses are stored using the bitwise XOR operator. Every node stores the XOR address of the preceding and next nodes rather than the real memory address.

Which of the following best sums up an array?

Correct! Wrong!

Only members of the same type are included in arrays.

Premium Tests $49/mo
FREE December-2024