sdp4

Description

Quiz on sdp4, created by 1610 R on 24/05/2018.
1610 R
Quiz by 1610 R, updated more than 1 year ago
1610 R
Created by 1610 R over 6 years ago
347
1

Resource summary

Question 1

Question
Choosing pivot and place all items smaller than pivot to the left and bigger ones to the right, then repeat the same with two branches is similar to _____________ sort algorithm.
Answer
  • quick
  • merge
  • bubble
  • heap

Question 2

Question
Inventor of merge sort is ?
Answer
  • John von Neumann
  • Mr Merge
  • John Lennon
  • Professor Sortmerg

Question 3

Question
А collision occurs when ... ?
Answer
  • two keys hash to the same table index.
  • two values hash to the same table index
  • two keys are hashed to big table inde and rehash needed
  • impossible to answer

Question 4

Question
What are the two parts of ADT?
Answer
  • private, public
  • methods and data fields
  • Parent and Child
  • Int and Float
  • Queue and Stack

Question 5

Question
List two ways of organizing hashtable.
Answer
  • open addressing and chaining
  • key and value
  • arraylist and vector
  • Breadth first search and Depth first search

Question 6

Question
Which of them has more methods?
Answer
  • Subclass
  • Superclass
  • Parentclass
  • Object

Question 7

Question
Indicate the relationship of HastableOpen and Entry classes?
Answer
  • has-a
  • static
  • is-b
  • is-a

Question 8

Question
The relationship when one class is defined inside the definition of another ?
Answer
  • has-a
  • is
  • is-a

Question 9

Question
Which of them is NOT an example of Data Structure ?
Answer
  • ArrayList
  • Breadth First Search
  • Set
  • Priority Queue
  • Graph

Question 10

Question
Redefinition of method of superclass in a subclass with the same name and number of parameters?
Answer
  • Override
  • Overload
  • Public
  • Encapsulation

Question 11

Question
A set view of a map can be obtained through method_______?
Answer
  • entrySet
  • setView
  • goAhead
  • emptySet

Question 12

Question
Which of them is NOT feature of collection interface ?
Answer
  • Graph
  • List
  • Queue
  • Vector
  • Set

Question 13

Question
Redefinition of method with the same name but different number of parameters?
Answer
  • Overload
  • Override
  • Encapsulation
  • Polymorphism

Question 14

Question
If you want to call the constructor of superclass you would use
Answer
  • Super()
  • Parent()
  • that()

Question 15

Question
Quadratic probing is usually used to ?
Answer
  • reduce collisions
  • reallocate array
  • for fun
  • enlarge table size

Question 16

Question
This returns TRUE if the collection contains object
Answer
  • Find(obj)
  • goTo(obj)
  • indexF(obj)
  • contains(obj)
  • indexOf(obj)

Question 17

Question
If you want to call different constructor of current class you would use
Answer
  • this()
  • that()
  • anay()
  • which()

Question 18

Question
Elements of a List are accessed by means of an
Answer
  • index
  • position
  • book
  • loop
  • switch

Question 19

Question
Set of ordered pairs whose element are known as the key and value is ?
Answer
  • set
  • map
  • graph
  • array

Question 20

Question
If there is at least one abstract method in a class, that class is called
Answer
  • Abstract class
  • Child class
  • Parent class
  • Not given

Question 21

Question
If there are no abstract methods in the class we call that class…
Answer
  • Actual class
  • Abstract class
  • Parent
  • Superclass

Question 22

Question
A list can ___ or ___ as items(elements) are added or removed
Answer
  • flow, shrink
  • grow, shrink
  • decrease, think
  • fly, sit
  • increase, grow

Question 23

Question
Is it possible to inherit from multiple classes ?
Answer
  • No
  • Yes

Question 24

Question
Is it possible to implement multiple interfaces?
Answer
  • no
  • yes

Question 25

Question
The Collection is a _____ of a List ?
Answer
  • superinterface
  • father
  • node
  • parent
  • interface

Question 26

Question
Every class has _____as a superclass
Answer
  • Object(parent of classes)
  • Object(childof classes)
  • Superclass
  • int

Question 27

Question
Which method returns an object at the top of a Stack in JAVA?
Answer
  • top()
  • pop()
  • front()
  • peek()
  • poll()

Question 28

Question
InstanceOf used to test
Answer
  • Whether an object belongs to class or not
  • Division by zero may occur
  • class belongs to object

Question 29

Question
Which method adds an item on the top of a Stack in JAVA?
Answer
  • add()
  • top()
  • peek()
  • push()
  • bush()

Question 30

Question
Two JAVA API Implementation of Set and Map are
Answer
  • tree and hash
  • graph and vector
  • list and hash
  • tree and list

Question 31

Question
What is not perfect in this code: ave = sum/count;
Answer
  • Division by zero may occur
  • Division by one may occur
  • nothing
  • not given

Question 32

Question
First in last out structure is...
Answer
  • Tree
  • Graph
  • Set
  • Queue
  • Stack

Question 33

Question
Attempt to convert a string that is not numeric to a number faults …
Answer
  • NumberFormatException
  • ArrayIndexOutOfBoundsException
  • DivisionByZero

Question 34

Question
Which structure is widely used in finding palindrome problem?
Answer
  • Map
  • Stack
  • Graph
  • Queue
  • Set

Question 35

Question
Average time complexity of Insertion sort is?
Answer
  • O(n^2)
  • O(1)
  • O(nlogn)
  • O(logn)
  • O(n)

Question 36

Question
Attempt to access array element using index less than zero folds
Answer
  • ArrayIndexOutOfBoundsException
  • NumberFormatException
  • OutOfBoundsException

Question 37

Question
Which container is not appropriate to implement Stack in JAVA?
Answer
  • Array
  • Graph
  • List
  • Vector

Question 38

Question
________ exception is an error normally due to programmer
Answer
  • unchecked
  • checked
  • not given
  • null

Question 39

Question
Which structure is widely used to calculate the value of postfix expression?
Answer
  • String
  • Array
  • Set
  • Stack
  • Queue

Question 40

Question
A hash table uses hashing to transform an items key into a table index so that iterations, retrievals and deletions can be performed in expected ___________ time.
Answer
  • O(1)
  • O(n)
  • O(n^2)
  • O(nlogn)
  • O(logn)

Question 41

Question
________ exception is an error normally not due to programmer
Answer
  • unchecked
  • checked
  • null
  • not given

Question 42

Question
Calculate value of "4 7 * 20 - "
Answer
  • 1
  • 3
  • 136
  • 8
  • 144

Question 43

Question
ADT that enables a user to access information (data) corresponding to a specified key.
Answer
  • Map
  • Queue
  • Set
  • Graph

Question 44

Question
Ability of object of one class to act like it is an object of another class is?
Answer
  • Inheritance
  • Polymorphism
  • Encapsulation
  • Java code
  • SLOC (Source Line of Code)

Question 45

Question
What does method empty return for empty stack?
Answer
  • nothing
  • empty
  • hello
  • true
  • false

Question 46

Question
Which of the following is not example of visibility in Java ?
Answer
  • Eclipse
  • JetBrains
  • NetBeans

Question 47

Question
Waiting line of people is similar to which data structure?
Answer
  • Graph
  • Stack
  • Queue
  • Tree
  • LinkedList

Question 48

Question
Sets the element on position Index to reference entry
Answer
  • Set (Index, Entry )
  • GEt(Index, Entry)
  • Nothing
  • Set(Entry)

Question 49

Question
Average time complexity of Merge sort is?
Answer
  • O(nlogn)
  • O(1)
  • O(logn)
  • O(n)
  • O(n^2)

Question 50

Question
You can reference an object of a ___ type through a variable of a ___ type
Answer
  • subclass, superclass
  • superclass, subclass
  • subclass, parent class
  • interface, subclass

Question 51

Question
Most sorting algorithm are divided into two basic groups.
Answer
  • fast and slow
  • go amd play
  • sort and search
  • ordered and unordered

Question 52

Question
What is the time complexity of insert(index) method in ArrayList
Answer
  • O(n)
  • O(n^2)
  • O(1)
  • O(n^3)

Question 53

Question
You cast an object referenced by a___ type to an object of a___ type in order to apply methods of the___type to the object –___ :
Answer
  • subclass, superclass, subclass, downcast
  • superclass, subclass, subclass, downcast
  • subclass, subclass, superclass, downcast
  • subclass, subclass, downcast, superclass

Question 54

Question
Which structure is better to use when printing many documents from multiple computers at one printer?
Answer
  • Set
  • Queue
  • Graph
  • Stack
  • Tree

Question 55

Question
What is the difference between ArrayList and Vector?
Answer
  • Vector is synchronized, where ArrayList is not
  • there are same
  • ArrayLIst is synchronized, where Vectoris not

Question 56

Question
JAVA API uses ____________ to implement both Set and Map interfaces.
Answer
  • hash table
  • tree table
  • vector
  • graph
  • ArrayList

Question 57

Question
If we call remove() function for the queue, which item will be removed
Answer
  • third
  • second
  • middle
  • first
  • last

Question 58

Question
Each node is a single-linked list, has a reference to__ and __
Answer
  • next node, previous node
  • next node, data
  • data, next node
  • implement, next node

Question 59

Question
For(int i=0; i<size; i++){ If(theData[i]==entry){ Return i; }Return -1;} This method is similar to which method of ArrayList
Answer
  • IndexOf(entry)
  • number
  • IndexOf(cell)
  • not given

Question 60

Question
What function return first added item in the queue?
Answer
  • giveMeFirst()
  • front()
  • first()
  • goBack()
  • element()

Question 61

Question
Indicate constant time complexity in terms of Big-O notation
Answer
  • O(1)
  • O(n)
  • O(n^2)
  • O(n^3)

Question 62

Question
This method associates specified value with the specified key in the map.
Answer
  • put(key,value)
  • set(key,value)
  • get(key,value)
  • key.set(key,value)

Question 63

Question
Which function is used to add new item in the queue?
Answer
  • add()
  • suffer()
  • remove()
  • offer()
  • poll()

Question 64

Question
The collection of abstract methods is called
Answer
  • Interface
  • Polymorphism
  • Super()
  • Tree

Question 65

Question
Indicate logarithm time complexity in terms of big-O notation?
Answer
  • log(n)
  • log(1)
  • log(n^2)
  • log(n^3)

Question 66

Question
Average time complexity of Shell sort is?
Answer
  • O(n^1.25)
  • O(n)
  • O(n^2)
  • O(nlogn)
  • O(1)

Question 67

Question
Indicate linear time complexity in terms of big-O notation?
Answer
  • n
  • logn
  • n^2
  • n^3

Question 68

Question
Indicate exponential time complexity in terms of big-O notation?
Answer
  • O(2^n)
  • O(3^n)
  • O(1)
  • O(n)

Question 69

Question
What determines whether you should use quadratic sort or a logarithmic sort algorithm?
Answer
  • array size
  • array indexes
  • array type
  • array values
  • swapping conditions

Question 70

Question
Find the slowest time
Answer
  • O(n!)
  • O(1)
  • O(logn)
  • O(n^2)

Question 71

Question
What is the time complexity of ArrayList remove(index) method
Answer
  • O(n)
  • O(1)
  • O(n^2)
  • O(n^3)

Question 72

Question
In a double-linked list, each node has a reference to: ___, ___and ___
Answer
  • next node, previous node, data
  • implement, data, next node
  • next node, data, previous node
  • data, next node previous node

Question 73

Question
In open addressing you can not remove an item to be deleted, so what should you do instead?
Answer
  • mark as deleted flag
  • do nothing
  • delete and save in temporary list
  • change its palce with another item

Question 74

Question
What is the time complexity of adding an item in front of a LinkedList
Answer
  • O(1)
  • O(n)
  • O(n!)
  • O(logn)

Question 75

Question
Average time complexity of Bubble sort is?
Answer
  • O(n^2)
  • O(nlogn)
  • O(1)
  • O(n)
  • O(logn)

Question 76

Question
What is the time complexity of insert(index) method in ArrayList?
Answer
  • O(n^2)
  • O(n)
  • O(1)
  • O(mxn)
  • O(logn)

Question 77

Question
To remove an item from a single -linked list, you need a reference to
Answer
  • previous node
  • next node
  • data
  • the node

Question 78

Question
What is the time complexity of adding element in the beginning of ArrayList
Answer
  • O(n)
  • O(n!)
  • O(1)
  • O(logn)

Question 79

Question
If two or more keys will be encoded to the same index of a hashtable, it is called.
Answer
  • collision
  • error
  • mistake
  • duplicate

Question 80

Question
Which method removes an item on the top of a Stack in JAVA?
Answer
  • peek()
  • pop()
  • hop()
  • remove()
  • drop()

Question 81

Question
To remove an item from a double -linked list, you need a reference to
Answer
  • data
  • node
  • next
  • previous node

Question 82

Question
Which method searches for target and returns its position in LinkedList
Answer
  • IndexOf(target)
  • IndexOf(cell)
  • Not given
  • ArrayIndexOutOfBloundException

Question 83

Question
Inheritance is:
Answer
  • powerful code reuse mechanism
  • providing access to data
  • ability of object of one class to act like it is an object of another class
  • hiding an access to data
  • powerful technique to store all data together

Question 84

Question
Hiding access to data members of a class is called:
Answer
  • Polymorphism
  • Encapsulation
  • Inheritence
  • None of them

Question 85

Question
An iterator allows us to access items of a list
Answer
  • sequentially
  • ordinal
  • together
  • don't know

Question 86

Question
The relationship when one class is a subclass of another is called:
Answer
  • has
  • is
  • can
  • are
  • include

Question 87

Question
How to remove item from LinkedList
Answer
  • Change Link of previous item to next item of item to be removed
  • Change Item
  • Change Link of next item to previous item to be changed
  • Change Link of next item to previous item of item to be removed

Question 88

Question
___testing focuses on testing the functional characteristics of a module
Answer
  • Green-box
  • Terminal
  • White-box
  • Black-box

Question 89

Question
Ideal data structure for a contact list is ?
Answer
  • tree
  • map
  • graph
  • set
  • vector

Question 90

Question
___testing requires the use of test data that exercise each statement in a module
Answer
  • White-box
  • Black-box
  • Terminal
  • Green-box

Question 91

Question
What is attribute of CircularList
Answer
  • next of last item referencing to the first item
  • set of Nubmber
  • Rules
  • last of next item referencing to the last item

Question 92

Question
You apply method ____________ to set view to get an object that facilitates sequential access to the Map elements.
Answer
  • iterator
  • accessor
  • traversal
  • preorder

Question 93

Question
What is popularity used to traverse SingleLinkedList
Answer
  • Interface
  • Iterator
  • Traversator
  • Loop and switch
  • Commutator

Question 94

Question
Which of the following in Java is very similar to “contract”?
Answer
  • next of last item referencing to the first item
  • Interface implementation
  • Inheritance
  • Access denied

Question 95

Question
The java linked-list class uses a ___ to implement the list interface
Answer
  • array-linked list
  • array list
  • linked list
  • double-linked list

Question 96

Question
List iterator and iterator is the same thing in JAVA
Answer
  • True
  • False

Question 97

Question
Is it possible to traverse containing of a list this way? for(int nextInt : aList){… }
Answer
  • yes
  • no
  • maybe

Question 98

Question
Show the method which exists in a DoubleLinkedList and not exist in a SingleLinkedList
Answer
  • Previous()
  • Last()
  • Next()
  • This()

Question 99

Question
Can we access the element of a set by index?
Answer
  • no
  • yes

Question 100

Question
What relationship class Node and LinkedList have?
Answer
  • has-a
  • has
  • is
  • is-a

Question 101

Question
A listIterator allows us to access the elements
Answer
  • both forward and backward
  • backward
  • neither forward nor backward
  • forward

Question 102

Question
Which of them is NOT an example of Data Structure ?
Answer
  • Breadth First Search
  • Search
  • Search1

Question 103

Question
A queue is a ___-in ___-out data structure
Answer
  • first, first
  • first, last
  • last, first
  • last, last

Question 104

Question
Operating system use ___ to determine which print job should be handled next
Answer
  • queue
  • stack
  • order
  • depth

Question 105

Question
Two JAVA API implementation of Set and Map are:
Answer
  • tree anf hash
  • tree and list
  • vector
  • arrayList

Question 106

Question
int xxx(int x){ if(n==1)return 1; return x*xxx(x-1); }
Answer
  • n!
  • log(n)
  • fibonacci
  • 2^n

Question 107

Question
.Data structure similar to tree but it doesn't have limitation according to number of parents is?
Answer
  • graph
  • tree
  • hash
  • vector

Question 108

Question
int xxx(int x, int y, int z){ if(z==1){return 1;} return xxx(x+y,x,z-1); }
Answer
  • fibonacci
  • n!
  • trash in function
  • logn

Question 109

Question
Explain how interface is like a contract
Answer
  • Class implementing interface must define none of it’s methods
  • Class implementing interface must define all it’s methods
  • Class implementing interface must define only one of it’s methods
  • Class implementing interface must define some of it’s methods

Question 110

Question
Node of a graph is called?
Answer
  • vertex
  • edge
  • root

Question 111

Question
What is the time complexity of recursive Binary Search algorithm?
Answer
  • O(logn)
  • O(n)
  • O(1)
  • O(2^n)

Question 112

Question
Recursive implementation works faster than lopped one
Answer
  • True
  • False

Question 113

Question
It's possible to implement all recursive algorithms without
Answer
  • True
  • False

Question 114

Question
Recursive solutions are more beautiful and easy to understands
Answer
  • True
  • False

Question 115

Question
Set of connections between vertices of a graph is called?
Answer
  • edge
  • vertex
  • path
  • root

Question 116

Question
What are two important differences between abstract class and actual class? What are the similarities?
Answer
  • Abstract class should have abstract methods. It can’t be instantiated. They both may have actual datafields and methods
  • Actual class should have abstract methods. It can’t be instantiated. They both may have actual datafields and methods
  • Abstract class should have actual methods. It can be instantiated. They both may have actual datafields and methods
  • Actual class should have actual methods. It can be instantiated. They both have not abstract datafields and methods
  • Abstract class should have not abstract methods. It can be instantiated. They both may have actual datafields and methods

Question 117

Question
Quicksort is implemented recursively
Answer
  • True
  • False

Question 118

Question
List four subclasses of RuntimeException: IndexOutOfBounds, Arithmetic, IlegalArgument,
Answer
  • OutputMismatch
  • InputMismatch
  • Logarithmic
  • LegalArgument
  • IllegalMismatch

Question 119

Question
What the time complexity of LinearSearch algorithm?
Answer
  • O(n)
  • O(1)
  • O(logn)
  • O(nlogn)

Question 120

Question
Graph where each edge has a direction is called?
Answer
  • directed
  • symmetric
  • unconnected

Question 121

Question
How protected visibility can be equivalent to public?
Answer
  • If two related classes are in the different package.
  • If two related classes are in the same package.
  • If one related class is in the same package.
  • If two related methods are in the same package.
  • If two related methods are in the different package.

Question 122

Question
for(i<n) if(a[i] == item) return i; This algorithm is similar to ...
Answer
  • Linear Search
  • Binary Search
  • Huffman tree
  • Full binary search

Question 123

Question
Adjacent matrix representing undirected graph should be?
Answer
  • symmetric
  • assymmetric
  • connected

Question 124

Question
Explain why Shape can not be an actual class
Answer
  • Because it has abstract methods
  • Because it has actual methods
  • Because it has not abstract methods
  • Because it has not actual methods

Question 125

Question
To use Binary Search items should be ...
Answer
  • ordered
  • traversed
  • matched
  • divorced

Question 126

Question
Vertex is ________ to another vertex if there is an edge connecting them
Answer
  • adjacent
  • subling
  • brotherhood
  • BFS

Question 127

Question
Overriding
Answer
  • the different method realized differently in a child class.
  • the same method realized differently in a child class.
  • the same method realized samely in a child class.
  • the same method not realized differently in a child class.
  • the same method realized differently in a parent class.

Question 128

Question
.A __________ is a sequence of vertices in which each successive vertex is connected to its predecessor. (Graphs)
Answer
  • path
  • cycle
  • route
  • weight

Question 129

Question
Overloading
Answer
  • the same method realized differently in a child class.
  • when number of parameters changed then it will be another method.
  • the same method realized differently in a parent class.
  • when single of parameter changed then it will be another method.
  • when number of parameters changed then it still will be same method.

Question 130

Question
A ___________ path is a simple path in which only the first and last items are the same.
Answer
  • cycle
  • trip
  • mapped
  • looped

Question 131

Question
The node of a tree without children is called ...?
Answer
  • leaf
  • subtree
  • siding
  • full

Question 132

Question
Describe the use of the keywords super. and super(...)?
Answer
  • If you want to call some method of parent class then use super.
  • If you want to call some method of child class then use super.
  • If you want to call some method of parent class then use normal.
  • If you want to call some method of child class then use normal.
  • If you want to call some method of parent class then do not use super.

Question 133

Question
.If there is no path path from vertex to any other vertex that graph is considered to be ?
Answer
  • unconnected
  • connected

Question 134

Question
A _______ of a node is a tree whose root is a child of that node
Answer
  • parent
  • subtree
  • leaf
  • root
  • child

Question 135

Question
What can you say about class Object?
Answer
  • Object is child of all classes in JAVA.
  • Object is parent of one class in JAVA.
  • Object is child of one class in JAVA.
  • Object is parent of all classes in JAVA.
  • Object is parent of some class in JAVA.

Question 136

Question
Indicate two ways of graph implementations
Answer
  • list and matrix
  • hash and list
  • ArrauList and vector
  • Tree and map

Question 137

Question
.A __________ graph is one in which [E] is close to but less than [V]^2.
Answer
  • dense
  • sparse
  • cute
  • bad

Question 138

Question
Describe the difference between is - a and has - a relationships?
Answer
  • Has - a – parent child relationship Is - a – when one class has another inside itself.
  • Has - a – parent child relationship Is - a – when all classes have another inside itself.
  • Is - a – parent child relationship Has - a – when one class has another inside itself.
  • Is - a – parent child relationship Has - a – when all classes have another inside itself.

Question 139

Question
A ________ graph is one where [E] is much less than [V]^2.
Answer
  • sparse
  • dense
  • i don`t know
  • go home and cry

Question 140

Question
What is the advantage of specifying an abstract data type as an interface instead of just going ahead and implementing it as a class?
Answer
  • Any class can implement many interface and can not extend more than one class
  • All classes can implement only one interface and can not extend more than one class
  • All classes can implement only one interface and can extend more than one class
  • Any class can implement many interface and can extend more than one class
  • All class can implement many interface and can extend more than one class

Question 141

Question
Which of the graph implementation is more efficient in terms of memory usage?
Answer
  • list
  • tree
  • map
  • graph

Question 142

Question
The ______ of a node is a measure of its distance from the root
Answer
  • level
  • distance
  • parent
  • root
  • sibling

Question 143

Question
Which of the graph implementations is more simple?
Answer
  • matrix
  • list
  • tree

Question 144

Question
What are two different uses of a term interface in programming
Answer
  • Interface is a java keyword. Relationship between user and computer (HCI).
  • Interface is not a java keyword. Relationship between user and computer (HCI).
  • Interface is a java keyword. Relationship between programm and computer (HCI).
  • Interface is a not java keyword. Relationship between user and programm (HCI).
  • Interface is a java keyword. Relationship with user and computer (HCI).

Question 145

Question
Why do we need BFS and DFS algorithms?
Answer
  • to have fun
  • to traverse a graph
  • be aware of collision

Question 146

Question
Distance from the root to its deepest leaf is knows as ______ of a tree?
Answer
  • height
  • root
  • path
  • subtree
  • depth

Question 147

Question
What do abstract methods and interfaces have in common? How do they differ?
Answer
  • In interface methods are defined. But in abstract classes the abstract methods can be defined to show its default behaviour.
  • In interface methods are not defined. But in actual classes the abstract methods can be defined to show its default behaviour.
  • In interface methods are not defined. But in abstract classes the abstract methods can be defined to show its default behaviour.
  • In interface methods are defined. But in abstract classes the actual methods can be defined to show its default behaviour.
  • In interface methods are defined. But in abstract classes the abstract methods cannot be defined to show its default behaviour.

Question 148

Question
Traversing graph visiting a start node first, then all nodes that are adjacent to it next.
Answer
  • BFS
  • DFS

Question 149

Question
List two subclasses of IOException:
Answer
  • EOFException, FileFoundException
  • EOFException, FileNotFoundException
  • SQLException, FileNotFoundException
  • EOFException, SQLException

Question 150

Question
Traversing graph visiting a start node first, then choose one node that is adjacent to it next.
Answer
  • BFS
  • DFS

Question 151

Question
Dijkstra's algorithm use ______ algorithm to traverse all nodes.
Answer
  • BFS
  • DFS

Question 152

Question
Explain why Shape can not be an interface
Answer
  • Because it has not actual methods
  • Because it has actual methods
  • Because it has abstract methods
  • Because it has not abstract methods
  • Because it has actual and abstract methods

Question 153

Question
Graph is considered to be ___________ if there is a path from each vertex to any other vertex.
Answer
  • connected
  • full
  • directed

Question 154

Question
.In ___________ graph is {v, u} is edge then {u, v} is not necessary an edge
Answer
  • directed
  • connected

Question 155

Question
Tree where every item must have at most 2 children is called?
Answer
  • Binary Tree
  • Unary Tree
  • Huffman Tree
  • General Tree

Question 156

Question
Structured set of data is called _______.
Answer
  • data structure
  • algorithm

Question 157

Question
What does encapsulation mean, and how it is used in JAVA?
Answer
  • Encapsulation – unlimiting access to datafields.
  • Encapsulation is one of the OOPs feature that allows us to perform a single action in different ways.
  • Encapsulation is one of the OOPs feature that is not allows us to perform a single action in different ways.
  • Encapsulation – limiting access to datafields.

Question 158

Question
An ordered set of instructions is called.
Answer
  • algorithm
  • model
  • data

Question 159

Question
What is the benefit of encoding letters trough Huffman tree
Answer
  • earning space
  • it is smart
  • just for fun
  • more beautiful
  • it is simple

Question 160

Question
Describe the use of the keywords this. and this (...)?
Answer
  • This() – used to get datafields of current class This. – used to call the constructor of current class.
  • This. – used to get datafields of current class This() – used to call the constructor of current class.
  • This. – used to call the constructor of current class This() – used to get datafields of current class
  • This. – used to get datafields of all classes This() – used to call the constructor of current class.
  • This. – used to get datafields of all classes This() – used to call the constructor of all classes.

Question 161

Question
Explain the relationship between classes Number, Integer and Short.
Answer
  • Number is child of Integer and Short.
  • Integer is parent of Number and Short.
  • Number is parent of Integer and Short.
  • Short is parent of Number and Integer.
  • Integer is child of Number and Short.

Question 162

Question
A tree where left child is less and right child is more than its parent called?
Answer
  • Binary
  • Huffman Tree
  • DFS
  • Breadth first search

Question 163

Question
Search a binary search tree costs?
Answer
  • O(logn)
  • O(nlogn)
  • O(1)
  • O(n)

Question 164

Question
The four kinds of visibility in order of decreasing visibility are:
Answer
  • Public, package, protected, private
  • Private, protected, package, public
  • Package, private, public, protected
  • Protected, package, private, public
  • Private, public, protected, package

Question 165

Question
What is default package visibility?
Answer
  • Classes in the different package are visible to each other without import.
  • Classes in the same package are visible to each other without import.
  • Classes in the same package are not visible to each other without import.
  • Classes in the different package are not visible to each other without import.
  • Classes in the same package are invisible to each other without import.

Question 166

Question
Form of method determined by its name and arguments
Answer
  • Java method
  • Signature method
  • Get method
  • Data method
  • Set method

Question 167

Question
A tree where all nodes should have 2 children and leaves have no children is called?
Answer
  • full binary tree
  • general tree
  • unary tree
  • perfect tree
  • binary tree

Question 168

Question
An____ specifies the requirements of an ADT as a contract between the____ and ____; A ____ implements the ADT
Answer
  • interface, user, developer, method
  • implemetation, developer, user, class
  • interface, developer, user,class
  • implemetation, user, developer, class
  • implemetation, developer, user, method

Question 169

Question
Visit root node, traverses left subtree, traverse right subtree traversal is called?
Answer
  • inorder
  • preorder
  • postorder

Question 170

Question
An interface can be implemented by multiple classes -
Answer
  • true
  • false

Question 171

Question
Traverse left subtree, Visit root node, traverse right subtree traversal is called?
Answer
  • preorder
  • inorder
  • postorder

Question 172

Question
traverse left subtree visit root node traversal is called?
Answer
  • inorder
  • postorder
  • preorder

Question 173

Question
This method of a binary tree class return true if tree is a leaf and false otherwise?
Answer
  • isLeaf()
  • isEmpty()
  • noMore()
  • isLast()
  • goHome()

Question 174

Question
Element insertion to a Binary Search tree costs?
Answer
  • O(logn)
  • O(1)
  • O(n)
  • O(nlogn)

Question 175

Question
Does binary search tree contain duplicates?
Answer
  • no
  • yes
  • go home
  • maybe

Question 176

Question
Complete binary tree where all children must be smaller than parents is?
Answer
  • maxheap
  • minheap
  • hiphop
  • treeheap

Question 177

Question
Complete binary tree where all children must be bigger than parents is?
Answer
  • minheap
  • maxheap
  • hiphop
  • fullheap
  • treeheap

Question 178

Question
Insert and remove items from a heap costs?
Answer
  • O(1)
  • O(n)
  • O(nlogn)
  • O(nxn)

Question 179

Question
The heap is used to implement the special kind of a queue called priority queue
Answer
  • heap
  • deap
  • DFS
  • DBS

Question 180

Question
A ________ tree is a binary tree used to store a code that facilitates the compression
Answer
  • heap
  • Huffman
  • Dijkstra
  • DFS
  • DBS

Question 181

Question
Data structure based on BST where all items are sorted and unique is?
Answer
  • graph
  • treeMap
  • treeSet
  • vector
  • tree

Question 182

Question
Recursive nonlinear data structure that is used to represent data organized in a hierarchy?
Answer
  • tree
  • vector
  • graph
  • arrayList
  • linkedList

Question 183

Question
In a Huffman tree, the item with the lowest frequency of occurrence will have the _____ code.
Answer
  • longest
  • easiest
  • shortest
  • binary
  • deepest

Question 184

Question
Which of the following is recursive algorithm?
Answer
  • QuickSort
  • Insertionsort
  • Selectionsort
  • BUBBLESORT

Question 185

Question
Average time complexity of Selection sort is?
Answer
  • O(n^2)
  • O(n^3)
  • O(n^2,25)
  • O(n)

Question 186

Question
Average time complexity of Heap sort is?
Answer
  • O(logn)
  • O(nlogn)
  • O(n)
  • O(1)

Question 187

Question
Average time complexity of Quick sort is?
Answer
  • O(nlogn)
  • O(logn)
  • O(n)
  • O(1)
Show full summary Hide full summary

Similar

Subh Milis le Seamus O Neill
l.watters97
Physics - P5
jacobaxford
History Revision
Ashkeeps
Romeo and Juliet essay
Tambo234
CHEMISTRY C1 2
x_clairey_x
An Inspector Calls - Quiz
Emily Morrison
Physical Geography
clongworth25
Checking out me History by John Agard
Eleanor Simmonds
Resumo global da matéria de Biologia e Geologia (10.º e 11.º anos)_2
Bruna Simaens
Animal Farm CONTEXT
Lydia Richards2113
PSBD New Edition
Aafnai Sathi