JAVA QUESTIONs 1. In implementation, this data structure suffers many of the sam
ID: 3697510 • Letter: J
Question
JAVA QUESTIONs
1. In implementation, this data structure suffers many of the same efficiency problems as an array:
a. queue
b. stack
c. linked list
d. array list
2. Number the following items in the data hierachy from lowest to highest (1-6)
file _ , record _ , bit _ , byte _ , character _, field _
3. This structure is designed to process data in the order in which it is received:
a. Queue
b. stack
c. linked list
d. array list
4. Given the following set of data 50 , 21, 80, 45, 16, 37. Applying the selection sort, write the state of the data set after each pass of the sorting algorithm.
5. Which of the following can have references created?
a. concrete class
b. abstract class
c. interface
6. which of the following can be instantiated?
a. concrete class
b. abstract class
c. interface
7. This data structure uses dynamically allocated nodes and usage is similar to an array?
a. queue
b. stack
c. linked list
d. array list
8. I have two separate instances of the same class with identical values in all of their data members referenced by two references, ref1 and ref2. How will the following statement resolve:
ref1 == ref2
a. true
b. false
c. depends on how that class'equals method is defined
d. will not compile
9. This structure is what is used to internally manage method call resolution
a. Queue
b. stack
c. linked list
d. array list
10. What happens when you open an existing file for write?
a. All writes will be added to the end of the current contents of the file
b. All writes will be added to the beginning of the current contents of the file
c. The current contents of the file are lost
d. A fairy gets its wings
Explanation / Answer
1)
Ans: d. array list
There is only one difference between array and array list. Array
list is resizable. But all operation have same time complexity
as an array.
2).
increasing order of size
Ans: bit < byte < character < field < record < file
3).
Ans: Queue
Queue is First-in-First out, means process in the order in
which it is received.
4).
Ans:
50 21 80 45 16 37
pass 1: 16 21 80 45 50 37
pass 2: 16 21 80 45 50 37
pass 3: 16 21 37 45 50 80
pass 4: 16 21 37 45 50 80
pass 5: 16 21 37 45 50 80
5).
Ans: a, b, c - All of above
But we can only create object of type concrete class.
6).
Ans: a. concrete class
7).
Ans: Linked List
Linked list is collected of node. Node is created
on demand (dynamically)
8).
Ans: ref1 == ref2 => false : because they denoted different object
9).
Ans: b. stack
10).
Ans: c. The current contents of the file are lost
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.