ANSWERS
A newly added node in a Heap is added _________________. - Answer- as a leaf node
and can remain as such, move up to become a parent node, or even become the root
A node in a Tree data structure keeps a pointer to its parent. - Answer- False
It is a great idea to always divide a process into multiple threads. - Answer- False
A heap is a binary Tree. - Answer- True
A ___________ inserts and removes items at the same index. - Answer- Stack
Consider a Min-Heap. Choose the statements that is true for a Min-Heap. - Answer- A
parent node key is lower than or equal of its children keys
Heaps provide search operation. - Answer- False
A Binary Search Tree can be stored in an array. - Answer- True
This data structure use unique values as keys. - Answer- Binary Search Tree
Which of the following statement(s) is/are correct:
1. Threads can use shared memory.
2. Separate processes use separate memory. - Answer- Both 1 and 2
___________ is the best type of data structure to serve requests (of equal priority) to
access a single shared resource (printer, disk, CPU) - Answer- Queue
A thread is a lightweight process. - Answer- True
A heap is always a binary search tree. - Answer- False
Using loops for traversing a binary search is better than using recursion. - Answer-
False
, Consider a class Test.java. Which of the following are valid constructors for this class.
Choose all answers that apply. - Answer- Test(){ } *
test(){ }
Test() {
System.out.println(" Hello ");
}
void Test(){} *
A class is a _________ - Answer- Template or construct of state and behavior
Test1 t1;
Test t2= new Test();
Variable t2 would be assigned a value ___________. - Answer- A place in the RAM
which stores an object of class Test
Test1 t1;
Test t2= new Test();
Variable t1 would be assigned a value ___________. - Answer- null
class Test {
int x=9;
}
has _____ constructor(s). - Answer- 1
class Test {
int x=9;
Test(){
}
}
has _____ constructor(s). - Answer- 1
We can create multiple ________ from a single ________. - Answer- objects, class
Test t2= new Test();
Test1 t1=t2;
What is true about t1? - Answer- t1 points to the same memory location as t2
A constructor has the following properties, choose all answers that apply. - Answer- A*:
Default constructor is present for all Java classes unless the programmer defines
another constructor