ACTUAL Exam Questions and CORRECT
Answers
Which one of the following are considered to be a benefit of using ADT Bag in Data Structure
A. Simplified API
B. Flexibility in element Type
C. All of the above
D. Dynamic Size - CORRECT ANSWER - All of the above
Which one of the following is NOT a possible behavior for ADT Bag
A. Check for Empty Bag
B. Obtain the Time Stamp of Objects
C. Add Objects
D. Remove Object - CORRECT ANSWER - Obtain the Time Stamp of Objects
What does ADT stands for?
A. Absolute Data Technique
B. Abstract Data Technique
C. Absolute Data Type
D. Abstract Data Type - CORRECT ANSWER - Abstract Data Type
Which one of the following is not considered disadvantage of ADT Bag:
A. Limited in complexity
,B. No Key Value Pairs
C. Simplicity
D. Lack of Sorting - CORRECT ANSWER - Simplicity
Which one is correct when using ADT Bag
A. Can perform only tasks specific to ADT
B. Can't use with new implementation
C. Can access data inside ADT without ADT operations
D. Must know how the data is stored prior to use - CORRECT ANSWER - Can perform
only tasks specific to ADT
Which one is correct?
A. Implementation of lists can be array-based, this is known as continues memory allocation. In
contiguous allocation, list elements occupy consecutive memory locations.
B. Implementation of lists can be array-based, this is known as contiguous memory allocation. In
contiguous allocation, list elements occupy consecutive memory locations.
C. Implementation of lists can be array-based, this is known as conventional memory allocation.
In contiguous allocation, list elements occupy consecutive memory locations.
D. Implementation of lists can be array-based, this is known as contiguous memory allocation. In
contiguous allocation, list elements occupy sequential memory locations. - CORRECT
ANSWER - Implementation of lists can be array-based, this is known as contiguous
memory allocation. In contiguous allocation, list elements occupy consecutive memory
locations.
T or F : A list is a collection of objects organized in a sequence and each list element is assigned
an integer index based on its position in the sequence.
A. True
B. False - CORRECT ANSWER - True
,To remove a node other than the first:
1. Set a reference to the predecessor of the targeted node.
2. Route the successor link in the predecessor around the targeted node.
A. True
B. False - CORRECT ANSWER - True
To traverse a linked list do the following:
A. None of the above
B. start a reference at the head of the list, and keep moving it from a node to a successor:
Node ref = myList;
while (ref == null)
{
System.out.println(ref.value);
ref = ref.next;
}
C. start a reference at the tail of the list, and keep moving it from a node to a successor:
Node ref = myList;
while (ref != null)
{
System.out.println(ref.value);
ref = ref.next;
}
D. start a reference at the head of the list, and keep moving it from a node to a successor:
Node ref = myList;
, while (ref != null)
{
System.out.println(ref.value);
ref = ref.next;
} - CORRECT ANSWER - start a reference at the head of the list, and keep moving it
from a node to a successor:
Node ref = myList;
while (ref != null)
{
System.out.println(ref.value);
ref = ref.next;
}
In linked allocation, the list keeps a reference to its first element: this is the tail reference
A. True
B. False - CORRECT ANSWER - False
Using the following code you can read the content of a file into an array: - CORRECT
ANSWER - final int SIZE = 10; // Assuming we know the size.
int[] numbers = new int[SIZE];
int i = 0;
File file = new File ("content.txt");
Scanner inputFile = new Scanner(file);