1610 R
Quiz by , created more than 1 year ago

Quiz on sdp4, created by 1610 R on 24/05/2018.

347
1
0
No tags specified
1610 R
Created by 1610 R over 6 years ago
Close

sdp4

Question 1 of 187

1

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.

Select one of the following:

  • quick

  • merge

  • bubble

  • heap

Explanation

Question 2 of 187

1

Inventor of merge sort is ?

Select one of the following:

  • John von Neumann

  • Mr Merge

  • John Lennon

  • Professor Sortmerg

Explanation

Question 3 of 187

1

А collision occurs when ... ?

Select one of the following:

  • 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

Explanation

Question 4 of 187

1

What are the two parts of ADT?

Select one of the following:

  • private, public

  • methods and data fields

  • Parent and Child

  • Int and Float

  • Queue and Stack

Explanation

Question 5 of 187

1

List two ways of organizing hashtable.

Select one of the following:

  • open addressing and chaining

  • key and value

  • arraylist and vector

  • Breadth first search and Depth first search

Explanation

Question 6 of 187

1

Which of them has more methods?

Select one of the following:

  • Subclass

  • Superclass

  • Parentclass

  • Object

Explanation

Question 7 of 187

1

Indicate the relationship of HastableOpen and Entry classes?

Select one of the following:

  • has-a

  • static

  • is-b

  • is-a

Explanation

Question 8 of 187

1

The relationship when one class is defined inside the definition of another ?

Select one of the following:

  • has-a

  • is

  • is-a

Explanation

Question 9 of 187

1

Which of them is NOT an example of Data Structure ?

Select one of the following:

  • ArrayList

  • Breadth First Search

  • Set

  • Priority Queue

  • Graph

Explanation

Question 10 of 187

1

Redefinition of method of superclass in a subclass with the same name and number of
parameters?

Select one of the following:

  • Override

  • Overload

  • Public

  • Encapsulation

Explanation

Question 11 of 187

1

A set view of a map can be obtained through method_______?

Select one of the following:

  • entrySet

  • setView

  • goAhead

  • emptySet

Explanation

Question 12 of 187

1

Which of them is NOT feature of collection interface ?

Select one of the following:

  • Graph

  • List

  • Queue

  • Vector

  • Set

Explanation

Question 13 of 187

1

Redefinition of method with the same name but different number of parameters?

Select one of the following:

  • Overload

  • Override

  • Encapsulation

  • Polymorphism

Explanation

Question 14 of 187

1

If you want to call the constructor of superclass you would use

Select one of the following:

  • Super()

  • Parent()

  • that()

Explanation

Question 15 of 187

1

Quadratic probing is usually used to ?

Select one of the following:

  • reduce collisions

  • reallocate array

  • for fun

  • enlarge table size

Explanation

Question 16 of 187

1

This returns TRUE if the collection contains object

Select one of the following:

  • Find(obj)

  • goTo(obj)

  • indexF(obj)

  • contains(obj)

  • indexOf(obj)

Explanation

Question 17 of 187

1

If you want to call different constructor of current class you would use

Select one of the following:

  • this()

  • that()

  • anay()

  • which()

Explanation

Question 18 of 187

1

Elements of a List are accessed by means of an

Select one of the following:

  • index

  • position

  • book

  • loop

  • switch

Explanation

Question 19 of 187

1

Set of ordered pairs whose element are known as the key and value is ?

Select one of the following:

  • set

  • map

  • graph

  • array

Explanation

Question 20 of 187

1

If there is at least one abstract method in a class, that class is called

Select one of the following:

  • Abstract class

  • Child class

  • Parent class

  • Not given

Explanation

Question 21 of 187

1

If there are no abstract methods in the class we call that class…

Select one of the following:

  • Actual class

  • Abstract class

  • Parent

  • Superclass

Explanation

Question 22 of 187

1

A list can ___ or ___ as items(elements) are added or removed

Select one of the following:

  • flow, shrink

  • grow, shrink

  • decrease, think

  • fly, sit

  • increase, grow

Explanation

Question 23 of 187

1

Is it possible to inherit from multiple classes ?

Select one of the following:

  • No

  • Yes

Explanation

Question 24 of 187

1

Is it possible to implement multiple interfaces?

Select one of the following:

  • no

  • yes

Explanation

Question 25 of 187

1

The Collection is a _____ of a List ?

Select one of the following:

  • superinterface

  • father

  • node

  • parent

  • interface

Explanation

Question 26 of 187

1

Every class has _____as a superclass

Select one of the following:

  • Object(parent of classes)

  • Object(childof classes)

  • Superclass

  • int

Explanation

Question 27 of 187

1

Which method returns an object at the top of a Stack in JAVA?

Select one of the following:

  • top()

  • pop()

  • front()

  • peek()

  • poll()

Explanation

Question 28 of 187

1

InstanceOf used to test

Select one of the following:

  • Whether an object belongs to class or not

  • Division by zero may occur

  • class belongs to object

Explanation

Question 29 of 187

1

Which method adds an item on the top of a Stack in JAVA?

Select one of the following:

  • add()

  • top()

  • peek()

  • push()

  • bush()

Explanation

Question 30 of 187

1

Two JAVA API Implementation of Set and Map are

Select one of the following:

  • tree and hash

  • graph and vector

  • list and hash

  • tree and list

Explanation

Question 31 of 187

1

What is not perfect in this code: ave = sum/count;

Select one of the following:

  • Division by zero may occur

  • Division by one may occur

  • nothing

  • not given

Explanation

Question 32 of 187

1

First in last out structure is...

Select one of the following:

  • Tree

  • Graph

  • Set

  • Queue

  • Stack

Explanation

Question 33 of 187

1

Attempt to convert a string that is not numeric to a number faults …

Select one of the following:

  • NumberFormatException

  • ArrayIndexOutOfBoundsException

  • DivisionByZero

Explanation

Question 34 of 187

1

Which structure is widely used in finding palindrome problem?

Select one of the following:

  • Map

  • Stack

  • Graph

  • Queue

  • Set

Explanation

Question 35 of 187

1

Average time complexity of Insertion sort is?

Select one of the following:

  • O(n^2)

  • O(1)

  • O(nlogn)

  • O(logn)

  • O(n)

Explanation

Question 36 of 187

1

Attempt to access array element using index less than zero folds

Select one of the following:

  • ArrayIndexOutOfBoundsException

  • NumberFormatException

  • OutOfBoundsException

Explanation

Question 37 of 187

1

Which container is not appropriate to implement Stack in JAVA?

Select one of the following:

  • Array

  • Graph

  • List

  • Vector

Explanation

Question 38 of 187

1

________ exception is an error normally due to programmer

Select one of the following:

  • unchecked

  • checked

  • not given

  • null

Explanation

Question 39 of 187

1

Which structure is widely used to calculate the value of postfix expression?

Select one of the following:

  • String

  • Array

  • Set

  • Stack

  • Queue

Explanation

Question 40 of 187

1

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.

Select one of the following:

  • O(1)

  • O(n)

  • O(n^2)

  • O(nlogn)

  • O(logn)

Explanation

Question 41 of 187

1

________ exception is an error normally not due to programmer

Select one of the following:

  • unchecked

  • checked

  • null

  • not given

Explanation

Question 42 of 187

1

Calculate value of "4 7 * 20 - "

Select one of the following:

  • 1

  • 3

  • 136

  • 8

  • 144

Explanation

Question 43 of 187

1

ADT that enables a user to access information (data) corresponding to a specified key.

Select one of the following:

  • Map

  • Queue

  • Set

  • Graph

Explanation

Question 44 of 187

1

Ability of object of one class to act like it is an object of another class is?

Select one of the following:

  • Inheritance

  • Polymorphism

  • Encapsulation

  • Java code

  • SLOC (Source Line of Code)

Explanation

Question 45 of 187

1

What does method empty return for empty stack?

Select one of the following:

  • nothing

  • empty

  • hello

  • true

  • false

Explanation

Question 46 of 187

1

Which of the following is not example of visibility in Java ?

Select one of the following:

  • Eclipse

  • JetBrains

  • NetBeans

Explanation

Question 47 of 187

1

Waiting line of people is similar to which data structure?

Select one of the following:

  • Graph

  • Stack

  • Queue

  • Tree

  • LinkedList

Explanation

Question 48 of 187

1

Sets the element on position Index to reference entry

Select one of the following:

  • Set (Index, Entry )

  • GEt(Index, Entry)

  • Nothing

  • Set(Entry)

Explanation

Question 49 of 187

1

Average time complexity of Merge sort is?

Select one of the following:

  • O(nlogn)

  • O(1)

  • O(logn)

  • O(n)

  • O(n^2)

Explanation

Question 50 of 187

1

You can reference an object of a ___ type through a variable of a ___ type

Select one of the following:

  • subclass, superclass

  • superclass, subclass

  • subclass, parent class

  • interface, subclass

Explanation

Question 51 of 187

1

Most sorting algorithm are divided into two basic groups.

Select one of the following:

  • fast and slow

  • go amd play

  • sort and search

  • ordered and unordered

Explanation

Question 52 of 187

1

What is the time complexity of insert(index) method in ArrayList

Select one of the following:

  • O(n)

  • O(n^2)

  • O(1)

  • O(n^3)

Explanation

Question 53 of 187

1

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 –___ :

Select one of the following:

  • subclass, superclass, subclass, downcast

  • superclass, subclass, subclass, downcast

  • subclass, subclass, superclass, downcast

  • subclass, subclass, downcast, superclass

Explanation

Question 54 of 187

1

Which structure is better to use when printing many documents from multiple computers at one printer?

Select one of the following:

  • Set

  • Queue

  • Graph

  • Stack

  • Tree

Explanation

Question 55 of 187

1

What is the difference between ArrayList and Vector?

Select one of the following:

  • Vector is synchronized, where ArrayList is not

  • there are same

  • ArrayLIst is synchronized, where Vectoris not

Explanation

Question 56 of 187

1

JAVA API uses ____________ to implement both Set and Map interfaces.

Select one of the following:

  • hash table

  • tree table

  • vector

  • graph

  • ArrayList

Explanation

Question 57 of 187

1

If we call remove() function for the queue, which item will be removed

Select one of the following:

  • third

  • second

  • middle

  • first

  • last

Explanation

Question 58 of 187

1

Each node is a single-linked list, has a reference to__ and __

Select one of the following:

  • next node, previous node

  • next node, data

  • data, next node

  • implement, next node

Explanation

Question 59 of 187

1

For(int i=0; i<size; i++){
If(theData[i]==entry){
Return i;
}Return -1;}
This method is similar to which method of ArrayList

Select one of the following:

  • IndexOf(entry)

  • number

  • IndexOf(cell)

  • not given

Explanation

Question 60 of 187

1

What function return first added item in the queue?

Select one of the following:

  • giveMeFirst()

  • front()

  • first()

  • goBack()

  • element()

Explanation

Question 61 of 187

1

Indicate constant time complexity in terms of Big-O notation

Select one of the following:

  • O(1)

  • O(n)

  • O(n^2)

  • O(n^3)

Explanation

Question 62 of 187

1

This method associates specified value with the specified key in the map.

Select one of the following:

  • put(key,value)

  • set(key,value)

  • get(key,value)

  • key.set(key,value)

Explanation

Question 63 of 187

1

Which function is used to add new item in the queue?

Select one of the following:

  • add()

  • suffer()

  • remove()

  • offer()

  • poll()

Explanation

Question 64 of 187

1

The collection of abstract methods is called

Select one of the following:

  • Interface

  • Polymorphism

  • Super()

  • Tree

Explanation

Question 65 of 187

1

Indicate logarithm time complexity in terms of big-O notation?

Select one of the following:

  • log(n)

  • log(1)

  • log(n^2)

  • log(n^3)

Explanation

Question 66 of 187

1

Average time complexity of Shell sort is?

Select one of the following:

  • O(n^1.25)

  • O(n)

  • O(n^2)

  • O(nlogn)

  • O(1)

Explanation

Question 67 of 187

1

Indicate linear time complexity in terms of big-O notation?

Select one of the following:

  • n

  • logn

  • n^2

  • n^3

Explanation

Question 68 of 187

1

Indicate exponential time complexity in terms of big-O notation?

Select one of the following:

  • O(2^n)

  • O(3^n)

  • O(1)

  • O(n)

Explanation

Question 69 of 187

1

What determines whether you should use quadratic sort or a logarithmic sort algorithm?

Select one of the following:

  • array size

  • array indexes

  • array type

  • array values

  • swapping conditions

Explanation

Question 70 of 187

1

Find the slowest time

Select one of the following:

  • O(n!)

  • O(1)

  • O(logn)

  • O(n^2)

Explanation

Question 71 of 187

1

What is the time complexity of ArrayList remove(index) method

Select one of the following:

  • O(n)

  • O(1)

  • O(n^2)

  • O(n^3)

Explanation

Question 72 of 187

1

In a double-linked list, each node has a reference to: ___, ___and ___

Select one of the following:

  • next node, previous node, data

  • implement, data, next node

  • next node, data, previous node

  • data, next node previous node

Explanation

Question 73 of 187

1

In open addressing you can not remove an item to be deleted, so what should you do
instead?

Select one of the following:

  • mark as deleted flag

  • do nothing

  • delete and save in temporary list

  • change its palce with another item

Explanation

Question 74 of 187

1

What is the time complexity of adding an item in front of a LinkedList

Select one of the following:

  • O(1)

  • O(n)

  • O(n!)

  • O(logn)

Explanation

Question 75 of 187

1

Average time complexity of Bubble sort is?

Select one of the following:

  • O(n^2)

  • O(nlogn)

  • O(1)

  • O(n)

  • O(logn)

Explanation

Question 76 of 187

1

What is the time complexity of insert(index) method in ArrayList?

Select one of the following:

  • O(n^2)

  • O(n)

  • O(1)

  • O(mxn)

  • O(logn)

Explanation

Question 77 of 187

1

To remove an item from a single -linked list, you need a reference to

Select one of the following:

  • previous node

  • next node

  • data

  • the node

Explanation

Question 78 of 187

1

What is the time complexity of adding element in the beginning of ArrayList

Select one of the following:

  • O(n)

  • O(n!)

  • O(1)

  • O(logn)

Explanation

Question 79 of 187

1

If two or more keys will be encoded to the same index of a hashtable, it is called.

Select one of the following:

  • collision

  • error

  • mistake

  • duplicate

Explanation

Question 80 of 187

1

Which method removes an item on the top of a Stack in JAVA?

Select one of the following:

  • peek()

  • pop()

  • hop()

  • remove()

  • drop()

Explanation

Question 81 of 187

1

To remove an item from a double -linked list, you need a reference to

Select one of the following:

  • data

  • node

  • next

  • previous node

Explanation

Question 82 of 187

1

Which method searches for target and returns its position in LinkedList

Select one of the following:

  • IndexOf(target)

  • IndexOf(cell)

  • Not given

  • ArrayIndexOutOfBloundException

Explanation

Question 83 of 187

1

Inheritance is:

Select one of the following:

  • 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

Explanation

Question 84 of 187

1

Hiding access to data members of a class is called:

Select one of the following:

  • Polymorphism

  • Encapsulation

  • Inheritence

  • None of them

Explanation

Question 85 of 187

1

An iterator allows us to access items of a list

Select one of the following:

  • sequentially

  • ordinal

  • together

  • don't know

Explanation

Question 86 of 187

1

The relationship when one class is a subclass of another is called:

Select one of the following:

  • has

  • is

  • can

  • are

  • include

Explanation

Question 87 of 187

1

How to remove item from LinkedList

Select one of the following:

  • 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

Explanation

Question 88 of 187

1

___testing focuses on testing the functional characteristics of a module

Select one of the following:

  • Green-box

  • Terminal

  • White-box

  • Black-box

Explanation

Question 89 of 187

1

Ideal data structure for a contact list is ?

Select one of the following:

  • tree

  • map

  • graph

  • set

  • vector

Explanation

Question 90 of 187

1

___testing requires the use of test data that exercise each statement in a module

Select one of the following:

  • White-box

  • Black-box

  • Terminal

  • Green-box

Explanation

Question 91 of 187

1

What is attribute of CircularList

Select one of the following:

  • next of last item referencing to the first item

  • set of Nubmber

  • Rules

  • last of next item referencing to the last item

Explanation

Question 92 of 187

1

You apply method ____________ to set view to get an object that facilitates sequential
access to the Map elements.

Select one of the following:

  • iterator

  • accessor

  • traversal

  • preorder

Explanation

Question 93 of 187

1

What is popularity used to traverse SingleLinkedList

Select one of the following:

  • Interface

  • Iterator

  • Traversator

  • Loop and switch

  • Commutator

Explanation

Question 94 of 187

1

Which of the following in Java is very similar to “contract”?

Select one of the following:

  • next of last item referencing to the first item

  • Interface implementation

  • Inheritance

  • Access denied

Explanation

Question 95 of 187

1

The java linked-list class uses a ___ to implement the list interface

Select one of the following:

  • array-linked list

  • array list

  • linked list

  • double-linked list

Explanation

Question 96 of 187

1

List iterator and iterator is the same thing in JAVA

Select one of the following:

  • True
  • False

Explanation

Question 97 of 187

1

Is it possible to traverse containing of a list this way? for(int nextInt : aList){… }

Select one of the following:

  • yes

  • no

  • maybe

Explanation

Question 98 of 187

1

Show the method which exists in a DoubleLinkedList and not exist in a SingleLinkedList

Select one of the following:

  • Previous()

  • Last()

  • Next()

  • This()

Explanation

Question 99 of 187

1

Can we access the element of a set by index?

Select one of the following:

  • no

  • yes

Explanation

Question 100 of 187

1

What relationship class Node and LinkedList have?

Select one of the following:

  • has-a

  • has

  • is

  • is-a

Explanation

Question 101 of 187

1

A listIterator allows us to access the elements

Select one of the following:

  • both forward and backward

  • backward

  • neither forward nor backward

  • forward

Explanation

Question 102 of 187

1

Which of them is NOT an example of Data Structure ?

Select one of the following:

  • Breadth First Search

  • Search

  • Search1

Explanation

Question 103 of 187

1

A queue is a ___-in ___-out data structure

Select one of the following:

  • first, first

  • first, last

  • last, first

  • last, last

Explanation

Question 104 of 187

1

Operating system use ___ to determine which print job should be handled next

Select one of the following:

  • queue

  • stack

  • order

  • depth

Explanation

Question 105 of 187

1

Two JAVA API implementation of Set and Map are:

Select one of the following:

  • tree anf hash

  • tree and list

  • vector

  • arrayList

Explanation

Question 106 of 187

1

int xxx(int x){

if(n==1)return 1;
return x*xxx(x-1);
}

Select one of the following:

  • n!

  • log(n)

  • fibonacci

  • 2^n

Explanation

Question 107 of 187

1

.Data structure similar to tree but it doesn't have limitation according to number of parents
is?

Select one of the following:

  • graph

  • tree

  • hash

  • vector

Explanation

Question 108 of 187

1

int xxx(int x, int y, int z){
if(z==1){return 1;}
return xxx(x+y,x,z-1);
}

Select one of the following:

  • fibonacci

  • n!

  • trash in function

  • logn

Explanation

Question 109 of 187

1

Explain how interface is like a contract

Select one of the following:

  • 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

Explanation

Question 110 of 187

1

Node of a graph is called?

Select one of the following:

  • vertex

  • edge

  • root

Explanation

Question 111 of 187

1

What is the time complexity of recursive Binary Search algorithm?

Select one of the following:

  • O(logn)

  • O(n)

  • O(1)

  • O(2^n)

Explanation

Question 112 of 187

1

Recursive implementation works faster than lopped one

Select one of the following:

  • True
  • False

Explanation

Question 113 of 187

1

It's possible to implement all recursive algorithms without

Select one of the following:

  • True
  • False

Explanation

Question 114 of 187

1

Recursive solutions are more beautiful and easy to understands

Select one of the following:

  • True
  • False

Explanation

Question 115 of 187

1

Set of connections between vertices of a graph is called?

Select one of the following:

  • edge

  • vertex

  • path

  • root

Explanation

Question 116 of 187

1

What are two important differences between abstract class and actual class? What are the
similarities?

Select one of the following:

  • 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

Explanation

Question 117 of 187

1

Quicksort is implemented recursively

Select one of the following:

  • True
  • False

Explanation

Question 118 of 187

1

List four subclasses of RuntimeException: IndexOutOfBounds, Arithmetic, IlegalArgument,

Select one of the following:

  • OutputMismatch

  • InputMismatch

  • Logarithmic

  • LegalArgument

  • IllegalMismatch

Explanation

Question 119 of 187

1

What the time complexity of LinearSearch algorithm?

Select one of the following:

  • O(n)

  • O(1)

  • O(logn)

  • O(nlogn)

Explanation

Question 120 of 187

1

Graph where each edge has a direction is called?

Select one of the following:

  • directed

  • symmetric

  • unconnected

Explanation

Question 121 of 187

1

How protected visibility can be equivalent to public?

Select one of the following:

  • 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.

Explanation

Question 122 of 187

1

for(i<n)
if(a[i] == item)
return i;
This algorithm is similar to ...

Select one of the following:

  • Linear Search

  • Binary Search

  • Huffman tree

  • Full binary search

Explanation

Question 123 of 187

1

Adjacent matrix representing undirected graph should be?

Select one of the following:

  • symmetric

  • assymmetric

  • connected

Explanation

Question 124 of 187

1

Explain why Shape can not be an actual class

Select one of the following:

  • Because it has abstract methods

  • Because it has actual methods

  • Because it has not abstract methods

  • Because it has not actual methods

Explanation

Question 125 of 187

1

To use Binary Search items should be ...

Select one of the following:

  • ordered

  • traversed

  • matched

  • divorced

Explanation

Question 126 of 187

1

Vertex is ________ to another vertex if there is an edge connecting them

Select one of the following:

  • adjacent

  • subling

  • brotherhood

  • BFS

Explanation

Question 127 of 187

1

Overriding

Select one of the following:

  • 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.

Explanation

Question 128 of 187

1

.A __________ is a sequence of vertices in which each successive vertex is connected to its
predecessor. (Graphs)

Select one of the following:

  • path

  • cycle

  • route

  • weight

Explanation

Question 129 of 187

1

Overloading

Select one of the following:

  • 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.

Explanation

Question 130 of 187

1

A ___________ path is a simple path in which only the first and last items are the same.

Select one of the following:

  • cycle

  • trip

  • mapped

  • looped

Explanation

Question 131 of 187

1

The node of a tree without children is called ...?

Select one of the following:

  • leaf

  • subtree

  • siding

  • full

Explanation

Question 132 of 187

1

Describe the use of the keywords super. and super(...)?

Select one of the following:

  • 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.

Explanation

Question 133 of 187

1

.If there is no path path from vertex to any other vertex that graph is considered to be ?

Select one of the following:

  • unconnected

  • connected

Explanation

Question 134 of 187

1

A _______ of a node is a tree whose root is a child of that node

Select one of the following:

  • parent

  • subtree

  • leaf

  • root

  • child

Explanation

Question 135 of 187

1

What can you say about class Object?

Select one of the following:

  • 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.

Explanation

Question 136 of 187

1

Indicate two ways of graph implementations

Select one of the following:

  • list and matrix

  • hash and list

  • ArrauList and vector

  • Tree and map

Explanation

Question 137 of 187

1

.A __________ graph is one in which [E] is close to but less than [V]^2.

Select one of the following:

  • dense

  • sparse

  • cute

  • bad

Explanation

Question 138 of 187

1

Describe the difference between is - a and has - a relationships?

Select one of the following:

  • 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.

Explanation

Question 139 of 187

1

A ________ graph is one where [E] is much less than [V]^2.

Select one of the following:

  • sparse

  • dense

  • i don`t know

  • go home and cry

Explanation

Question 140 of 187

1

What is the advantage of specifying an abstract data type as an interface instead of just going ahead and implementing it as a class?

Select one of the following:

  • 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

Explanation

Question 141 of 187

1

Which of the graph implementation is more efficient in terms of memory usage?

Select one of the following:

  • list

  • tree

  • map

  • graph

Explanation

Question 142 of 187

1

The ______ of a node is a measure of its distance from the root

Select one of the following:

  • level

  • distance

  • parent

  • root

  • sibling

Explanation

Question 143 of 187

1

Which of the graph implementations is more simple?

Select one of the following:

  • matrix

  • list

  • tree

Explanation

Question 144 of 187

1

What are two different uses of a term interface in programming

Select one of the following:

  • 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).

Explanation

Question 145 of 187

1

Why do we need BFS and DFS algorithms?

Select one of the following:

  • to have fun

  • to traverse a graph

  • be aware of collision

Explanation

Question 146 of 187

1

Distance from the root to its deepest leaf is knows as ______ of a tree?

Select one of the following:

  • height

  • root

  • path

  • subtree

  • depth

Explanation

Question 147 of 187

1

What do abstract methods and interfaces have in common? How do they differ?

Select one of the following:

  • 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.

Explanation

Question 148 of 187

1

Traversing graph visiting a start node first, then all nodes that are adjacent to it next.

Select one of the following:

  • BFS

  • DFS

Explanation

Question 149 of 187

1

List two subclasses of IOException:

Select one of the following:

  • EOFException, FileFoundException

  • EOFException, FileNotFoundException

  • SQLException, FileNotFoundException

  • EOFException, SQLException

Explanation

Question 150 of 187

1

Traversing graph visiting a start node first, then choose one node that is adjacent to it next.

Select one of the following:

  • BFS

  • DFS

Explanation

Question 151 of 187

1

Dijkstra's algorithm use ______ algorithm to traverse all nodes.

Select one of the following:

  • BFS

  • DFS

Explanation

Question 152 of 187

1

Explain why Shape can not be an interface

Select one of the following:

  • 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

Explanation

Question 153 of 187

1

Graph is considered to be ___________ if there is a path from each vertex to any other
vertex.

Select one of the following:

  • connected

  • full

  • directed

Explanation

Question 154 of 187

1

.In ___________ graph is {v, u} is edge then {u, v} is not necessary an edge

Select one of the following:

  • directed

  • connected

Explanation

Question 155 of 187

1

Tree where every item must have at most 2 children is called?

Select one of the following:

  • Binary Tree

  • Unary Tree

  • Huffman Tree

  • General Tree

Explanation

Question 156 of 187

1

Structured set of data is called _______.

Select one of the following:

  • data structure

  • algorithm

Explanation

Question 157 of 187

1

What does encapsulation mean, and how it is used in JAVA?

Select one of the following:

  • 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.

Explanation

Question 158 of 187

1

An ordered set of instructions is called.

Select one of the following:

  • algorithm

  • model

  • data

Explanation

Question 159 of 187

1

What is the benefit of encoding letters trough Huffman tree

Select one of the following:

  • earning space

  • it is smart

  • just for fun

  • more beautiful

  • it is simple

Explanation

Question 160 of 187

1

Describe the use of the keywords this. and this (...)?

Select one of the following:

  • 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.

Explanation

Question 161 of 187

1

Explain the relationship between classes Number, Integer and Short.

Select one of the following:

  • 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.

Explanation

Question 162 of 187

1

A tree where left child is less and right child is more than its parent called?

Select one of the following:

  • Binary

  • Huffman Tree

  • DFS

  • Breadth first search

Explanation

Question 163 of 187

1

Search a binary search tree costs?

Select one of the following:

  • O(logn)

  • O(nlogn)

  • O(1)

  • O(n)

Explanation

Question 164 of 187

1

The four kinds of visibility in order of decreasing visibility are:

Select one of the following:

  • Public, package, protected, private

  • Private, protected, package, public

  • Package, private, public, protected

  • Protected, package, private, public

  • Private, public, protected, package

Explanation

Question 165 of 187

1

What is default package visibility?

Select one of the following:

  • 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.

Explanation

Question 166 of 187

1

Form of method determined by its name and arguments

Select one of the following:

  • Java method

  • Signature method

  • Get method

  • Data method

  • Set method

Explanation

Question 167 of 187

1

A tree where all nodes should have 2 children and leaves have no children is called?

Select one of the following:

  • full binary tree

  • general tree

  • unary tree

  • perfect tree

  • binary tree

Explanation

Question 168 of 187

1

An____ specifies the requirements of an ADT as a contract between the____ and ____; A ____ implements the ADT

Select one of the following:

  • interface, user, developer, method

  • implemetation, developer, user, class

  • interface, developer, user,class

  • implemetation, user, developer, class

  • implemetation, developer, user, method

Explanation

Question 169 of 187

1

Visit root node, traverses left subtree, traverse right subtree traversal is called?

Select one of the following:

  • inorder

  • preorder

  • postorder

Explanation

Question 170 of 187

1

An interface can be implemented by multiple classes -

Select one of the following:

  • true

  • false

Explanation

Question 171 of 187

1

Traverse left subtree, Visit root node, traverse right subtree traversal is called?

Select one of the following:

  • preorder

  • inorder

  • postorder

Explanation

Question 172 of 187

1

traverse left subtree visit root node traversal is called?

Select one of the following:

  • inorder

  • postorder

  • preorder

Explanation

Question 173 of 187

1

This method of a binary tree class return true if tree is a leaf and false otherwise?

Select one of the following:

  • isLeaf()

  • isEmpty()

  • noMore()

  • isLast()

  • goHome()

Explanation

Question 174 of 187

1

Element insertion to a Binary Search tree costs?

Select one of the following:

  • O(logn)

  • O(1)

  • O(n)

  • O(nlogn)

Explanation

Question 175 of 187

1

Does binary search tree contain duplicates?

Select one of the following:

  • no

  • yes

  • go home

  • maybe

Explanation

Question 176 of 187

1

Complete binary tree where all children must be smaller than parents is?

Select one of the following:

  • maxheap

  • minheap

  • hiphop

  • treeheap

Explanation

Question 177 of 187

1

Complete binary tree where all children must be bigger than parents is?

Select one of the following:

  • minheap

  • maxheap

  • hiphop

  • fullheap

  • treeheap

Explanation

Question 178 of 187

1

Insert and remove items from a heap costs?

Select one of the following:

  • O(1)

  • O(n)

  • O(nlogn)

  • O(nxn)

Explanation

Question 179 of 187

1

The heap is used to implement the special kind of a queue called priority queue

Select one of the following:

  • heap

  • deap

  • DFS

  • DBS

Explanation

Question 180 of 187

1

A ________ tree is a binary tree used to store a code that facilitates the compression

Select one of the following:

  • heap

  • Huffman

  • Dijkstra

  • DFS

  • DBS

Explanation

Question 181 of 187

1

Data structure based on BST where all items are sorted and unique is?

Select one of the following:

  • graph

  • treeMap

  • treeSet

  • vector

  • tree

Explanation

Question 182 of 187

1

Recursive nonlinear data structure that is used to represent data organized in a hierarchy?

Select one of the following:

  • tree

  • vector

  • graph

  • arrayList

  • linkedList

Explanation

Question 183 of 187

1

In a Huffman tree, the item with the lowest frequency of occurrence will have the _____ code.

Select one of the following:

  • longest

  • easiest

  • shortest

  • binary

  • deepest

Explanation

Question 184 of 187

1

Which of the following is recursive algorithm?

Select one of the following:

  • QuickSort

  • Insertionsort

  • Selectionsort

  • BUBBLESORT

Explanation

Question 185 of 187

1

Average time complexity of Selection sort is?

Select one of the following:

  • O(n^2)

  • O(n^3)

  • O(n^2,25)

  • O(n)

Explanation

Question 186 of 187

1

Average time complexity of Heap sort is?

Select one of the following:

  • O(logn)

  • O(nlogn)

  • O(n)

  • O(1)

Explanation

Question 187 of 187

1

Average time complexity of Quick sort is?

Select one of the following:

  • O(nlogn)

  • O(logn)

  • O(n)

  • O(1)

Explanation