Data Structure Midterm Exam Ay 2023-2024
Data Structure Midterm Exam Ay 2023-2024
TEST I: Direction: Read each statement carefully. Select the correct letter that best suits
your answer by shading the corresponding circle on the answer sheet provided.
1. Shows the steps as boxes of various kinds and their order by connecting the boxes with
arrows.
a. Flowchart c. Input
b. Language d. Output
2. It is used to denote a particular way of organizing data for particular types of operation.
a. Pseudocode c. Algorithm
b. Data Structure d. Discrete Structure
3. These are basic data types provided by programming languages to represent simple values.
a. Primitive Pseudocode c. Algorithm
b. Primitive Data Structure d. Discrete Structure
4. This is a form of a variable to which a value can be assigned.
a. Pseudocode c. Abstract data type
b. Data Structure d. Data type
5. In Data structure which data elements are arranged sequentially?
a. Static Data Structure c. Dyanmic Data Structure
b. Linear data Structure d. Non-Linear Data Structure
6. Data structure in which data elements are not arranged sequentially and we can’t traverse
all the elements in a single run only.
a. Static Data Structure c. Dynamic Data Structure
b. Linear Data Structure d. Non-Linear Data Structure
7. This is a type of data structure whose size or structure is fixed at compile time and doest
not change during program execution.
a. Static Data Structure c. Dynamic Data Structure
b. Linear Data Structure d. Non-Linear Data Structure
8. This is a type of data structure whose size or structure is not fixed and can randomly be
updated during the program execution.
a. Static Data Structure c. Dynamic Data Structure
b. Linear Data Structure d. Non-Linear Data Structure
9. It is originally referred to as any comutation performed via a set of rules.
a. Algorithm c. Data Structure
b. Psuedocode d. Program
10. A high – level description of a program written for machine reading.
a. Algorithm c. Data Structure
b. Psuedocode d. Program
11. This is a type of control structure in which steps in an algorithm are constructed in such a
way that no, condition steps is required.
a. Control flow structure c. Counter structure
b. Sequence structure d. Decision structure
12. It enables the program to execute a certain section of code depending on the state of
variables, or values returned from methods.
a. If Statement c. Array
b. If/Else Statement d. LinkedList
13. It is a collection of items of the same variable type that are stored at contiguous memory
locations.
a. Tree c. Array
b. Stack d. LinkedList
14. A Linear Data Structure in which the elements are not stored at contiguous memory
locations.
a. Stack c. Array
b. Tree d. LinkedList
15. In flowcharting this indicates any type of internal operation inside the processor or
memory
a. Process c. Terminal
b. Decision d. Input/Output
16. Nodes in a linked list contains two things.
a. Direction and a pointer c. A pointer and a reference
b. Data and a pointer d. A pointer and a node
17. linked list is generally considered as an example of _____ type of memory allocation?
a. Static c. dynamic
b. Compile time d. none of these
18. What is the proper code for accessing the information of the second item in a link list/
a. Head.next c. Head.next.next.next
b. Head.next.next d. None of the above
19. What operation is done on the representation of the linked list below?
b.
c.
d.
21. What should the default constructor of the linkedListClass perform?
a. Nothing since the LinkedListNode class will take care of initialization
b. Initialize the first and last node (or head and tail) and set count to zero
c. Initialize the array to store the information in the linked list
d. All of the above
22. A linked is different form an array because
a. A linked list can handle more types of information than an array
b. An array cannot be sorted, but a linked list can be
c. an array is fixed in size, but a linked list is dynamically sizable
d. None of the above
23. What is a node used for in a linked list?
a. to store the information and the link to the next item
b. to check for the end of the list
c. not used in a linked list
d. All of the above
24. Giving the fixed size of an array is not important. Which class is more efficient at storing
and retrieving information?
a. A linked list because of the nodes
b. An array because of the reduced code and efficient storage allocation
c. Neither is more efficient than the other
d. None of the above
25. Which of these is NOT about the linked list?
a. A nonlinear collection of data elements
b. It can be used to implement several other common abstract data types ex. Stacks,
queue, tree
c. It uses more memory than arrays because of the storage used by their pointers.
d. Each record of a linked list is often called an “element” or “node”.
26. The following statements are true to the linked list EXCEPT?
a. The size of memory can be allocated or de-allocated at run time based on the operation.
b. The insertion and deletion of elements are simpler than arrays.
c. Linked list is a dynamic data structure in which elements are stored at a contiguous
location.
d. Adding a new node to a linked list involves adjusting the pointers of the existing nodes to
maintain the proper sequence.
27. All of the following are types of Linked List EXCEPT?
a. Singly Linked List c. Circular Linked List
b. Doubly Linked List d. Modular Linked List
28. All statements are true in Singly linked list EXCEPT?
a. Linked list contains a first link element called head
b. Each link carries a data field and a link field called next
c. Each link is linked with its next link using its head
d. The Last Link carries a link as null to mark the end of the list.
29. Which is NOT TRUE in the following statements?
a. In Data Searching, as data grows, the search will become faster.
b. Processor speed in data structure falls limited if the data grows to billions of records.
c. Data can be organized in a data structure in such a way that all items may not be required
to search, and the required data can be searched almost instantly.
d. Memory usage of data structure operations should be as little as possible.
30. Which is TRUE in the following Statements?
a. The data to be read or displayed uses a parallelogram symbol
b. Connector in flowchart is used for any logic comparison operation.
c. Pre-defined process is used to represent a group of statements that perform one processing
task.
d. Off-page connector indicates that the target is on the other page.
TEST II Direction: Read and understand the set of sentences in each given number. Choose the
correct letter of the correct answer.
31. 1. Removing a node from a linked list requires adjusting the pointers of the neighboring nodes to
bridge the gap left by the deleted node.
2. In a circular linked list the last node point back to the head node.
32. 1. The variables in the array are in order, and each has an index beginning with 1.
2. The size of an array must be specified by int or short value and not long.
34. 1. Doubly Linked list traversal of items can be done in both forward and backward directions.
2. Singly Linked list traversal of items can be done in one direction only.
36. 1. The if statement enables your program to execute a certain section of code.
2. The values returned from a method depend on the state of the data type of variable.
37. 1. If then else statements give you a test for a range of values for your variables.
2. An Array is named list of data items that all have the same data type.
38. 1. Elements are items stored in an array and can be accessed by their indexes.
2. The length of an array is determined by the number of elements it can contain.
40. 1. The switch statement evaluates the expression and compares it with the values of each label.
2. The break statement is used to terminate the execution of the switch statement.
TEST III: Direction: Analyze and evaluate the given code. Choose the correct letter from the
given choices.
Node 1 Node 2
newnode
43. From the representation given above what will be the linking after inserting the newNODE in the
MIDDLE, Where Node 1 = Rightnode, Node 2 = Leftnode, new Node = newnode
44. From the representation given above what will be the syntax after inserting the newNODE at the
BEGINNING, Where Node 1 = Rightnode, Node 2 = Leftnode, new Node = newnode
a. Head = null; c. newnode = new Node;
Head.next = Rightnode; newnode.next = head;
Rightnode.next = Leftnode; head = newNode;
Leftnode= null;
a. 56 42 74 40 38 62 c. 56 42 74 62 38 40
b. 62 38 40 74 42 56 d. 74 42 56 40 38 62
a. Code A c. Code C
b. Code B d. Code B and C
Prepared by: