Font size
WorksheetsMidterm Exam (BSIS 2-A)
Total questions: 75
Worksheet time: 1hrs 6mins
Data structures can be applied in stacks, queues, arrays, and linked lists only.
true
false
Data structures are also used in linked lists and hash tables.
true
false
A linear data structure is one in which the data elements are stored in sequential order.
true
false
A dynamic data structure is a collection of data in which memory size is fixed during runtime.
true
false
Primitive data structures are the fundamental data structures that are more complicated.
true
false
Stack principle is Last-In, First-Out (LIFO) or First-In, Last-Out (FILO).
true
false
Queue is a collection of objects with the principle of First-In, First-Out (FIFO).
true
false
Linked lists are dynamic; that is, memory is deallocated when required.
true
false
The address part of the last node stores a primitive value called NULL.
true
false
The advantage of a linked list over arrays is that now it is easier to insert and delete data elements.
true
false
An array is a collection of heterogeneous types of data elements in contiguous memory.
true
false
A subscript is an ordinal number used to identify an element of the array.
true
false
The data type means the different kinds of values it can remove.
true
false
The size of an array refers to the minimum number of values an array can hold.
true
false
Examples of traversal are counting all the data elements or performing any process on these elements in the array.
true
false
One-dimensional arrays are organized linearly in the memory.
true
false
The last node of a singly linked list will connect to the first node.
true
false
Practical application of linked list is how each car on a train is connected to its previous and next car (except the first and last).
true
false
Searching a particular element in the list is very easy and simple.
true
false
Dynamic memory allocation is best when we are aware of the memory requirements in advance.
true
false
A node can be deleted from the beginning of the linked list.
true
false
The insert operation always add nodes at the beginning of the list.
true
false
The delete operation removes a given node from the list.
true
false
One of the most important applications of linked lists is a polynomial representation.
true
false
Searching for a value in a list means to insert a particular element/value .
true
false
All the statements are correct except:
Array and linked lists are linear data structures.
Array and linked lists both store values of homogeneous type.
Array and linked lists allocate a memory space temporarily.
Array and linked lists store values permanently.
All the statements about array are correct except:
All the elements of the array are stored in linear order.
The data elements are stored in successive memory locations.
The elements of an array have different data types.
Each element in an array can be accessed using the same name.
What is an array subscript?
The subscript of the first element is zero.
The subscript of the last element is equal to the array size.
Use to identify an element of the array.
It is an ordinal number.
How to declare a single-dimension array?
Define the data type, array name, and array size.
Define the data type, array name, and array value.
Declaring an array involves two subscripts and array size.
Declaring an array involves different array names.
All statements are correct except:
Some examples of list operations are traversing, inserting, deleting, and searching.
To search in a linear list is an example of traversing.
Inserting at the beginning and end of a list always requires traversal.
It is advisable to check if the list is not empty before removing an item from the list.
To traverse in a single-dimension array or a singly linked list mean:
Search for a value in a list and add another value.
Access from the beginning up to the middle element and return the result.
Visit every element exactly once and process it.
Count all data elements found in an even position.
append( ) is used to:
Insert an element at the beginning of the list.
Insert an element at the end of the list.
Insert an element in any position.
Insert an element in at the desired position.
remove (25) will:
Delete the first value stored in the list.
Delete the last value stored in the list.
Delete all the matching elements.
Delete the first matching element.
The use of index() is to:
return the index of the first element with the specified value
return the index of the last element with the specified value
return the value of the first element within the list
return the value of the last element within the list
All statements are correct except:
the address of the elements in the 1-D array can be calculated
the address of the elements in the 2-D array cannot be calculated
We can merge two array/lists in Python by simply adding them.
To sort a list is to arrange them in ascending or descending order.
Which of the following statements is incorrect?
Initializing the array elements at compile time is the same way we initialize the variables at the time of their declaration.
There is a need to provide a specific value for every array element when it initializes.
Initialization of arrays can be done at the compile time.
Initialization of arrays can be done at the compile time and run time.
How can we identify an element in the array?
An element in an array can be identified by its index number, also known as a subscript.
An element in an array can be identified by its index number, which is a whole number equal to the array size.
An element in an array can be identified by its index number, also known as a subscript that is less than zero.
An element in an array can be identified by its index number, also known as a variable array.
All statements are true about NULL except:
The NULL node is used to represent the end of the linked list.
If head is NULL, the linked list is empty.
The NULL node is used to represent the start of the linked list.
If head.next is NULL, the linked list has a single node.
What is dynamic memory allocation?
Process of allocating memory during program creation.
Process of allocating memory to the variables during runtime.
Process of allocating memory during program compilation.
Process of allocating memory to the variables during program creation.
Which of the following statements is not true about node insertion?
A new node is inserted at the beginning of the linked list.
A new node is inserted at the end of the linked list.
A new node is inserted in a linked list when a node is removed.
A new node is inserted after the given node in a linked list.
What to do first when deleting a node from the beginning of the linked list?
Move self.head to self.head.next.
Check if the list is empty for underflow condition.
Print the underflow message on screen.
Delete from the beginning of the linked list.
What to do when deleting a node at the end of the linked list?
Check for overflow condition and set self.head to NULL.
Print an overflow message on the screen and set the node to NULL.
Locate the last node of the list and set the node to NULL.
Locate the second to the last node of the list and set the node.next to NULL.
All statements about linked list are correct except:
It is necessary to know the exact size or the exact number of elements.
It is a sequence of nodes containing one or more data fields that point to the next node.
NULL is used to denote an empty list and signify the last node of the list.
A linked list is a self-referential data type because each node points to another node of the same type.
Below are the advantages of a linked list except for one:
It can grow or shrink during the execution of the program.
They consume more space.
Linked lists have efficient memory utilization.
Many complex applications can be easily carried out with linked lists.
Find the statement that gives an incorrect description of the list operation.
For traversing a linked list, we use a temporary node variable, which points to the currently accessed node.
The search is successful if the searched value is present in the list.
Inserting a new node in a link list requires memory space allocation.
Sorting a list will concatenate two separate linked lists.
Below is the process for inserting a new node in an existing linked list except for:
A new node is inserted at the beginning of the linked list.
A new node is inserted at the end of the linked list.
A new node is inserted after the given node in a linked list.
A new node is inserted after the given node is removed from a linked list.
Which of the following statements is incorrect?
A node is deleted from the beginning of the linked list.
A node is deleted from the end of the linked list.
A node is deleted after a given linked list is already empty.
A node is deleted after a given node from the linked list.
How to concatenate two linked lists?
The end node reference of the first list will point to the head node of the second list.
The head node reference of the first list will point to the end node of the second list.
The end node reference of the first list will point to the end node of the second list.
The head node reference of the first list will point to the head node of the second list.
Which of the following statements is true about a circular linked list?
Circular linked list is a type of singly linked list in which the address part of the last node stores the value NULL.
Circular linked list is a type of singly linked list in which the address part of the last node stores the address of the first node.
While traversing a circular linked list, we must begin from the head node and traverse the list in any direction.
While traversing a circular linked list, we must begin from the head node and traverse the list in any direction.
What is the difference between a linked list and an array?
Arrays store elements in contiguous memory locations, while linked lists do not.
An array is dynamic in nature, while a linked list is static.
An array can store a heterogeneous type of values, while linked list stores a homogeneous type.
There is no way a linked list can grow the list size while an array can.
Assume that a single-dimensional array has a double type and the base address is 8875. Compute the address of element 45.
(a)
Assume that a single-dimensional array has an integer type and the base address is 1877. Compute the address of element 21.
(a)
Assume that a single-dimensional array has a character type and the base address is 3288. Compute the address of element 15.
(a)
Assume that a single-dimensional array has a float type and the base address is 1022. Compute the address of element 76.
(a)
Granting that the array size is 8 x 4, the base address is 1477, and the type is float. Compute the address of the array element in the row-major order given:
array[7][2]
(a)
Granting that the array size is 12 x 8, the base address is 800, and the type is double. Compute the address of the array element in the row-major order given: array[10][5]
(a)
Granting that the array size is 12 x 8, the base address is 800, and the type is integer. Compute the address of the array element in the column-major order given: array[10][5]
(a)
Granting that the array size is 10 x 20, the base address is 3800, and the type is float. Compute the address of the array element in the column-major order given: array[14][9]
(a)
Granting that the array size is 5 x 9, the base address is 5112, and the type is character. Compute the address of the array element in the row-major order given: array[3][2]
(a)
Granting that the array size is 8 x 5, the base address is 4455, and the type is double. Compute the address of the array element in the column-major order given: array[4][4]
(a)
(a)
(a)
(a)
(a)
(a)
(a)
(a)
(a)
(a)
(a)
(a)
(a)
Yes
No
Yes
No
(a)
