Inheritance is ...
Powerful code reuse mechanism
providing access to data
ability of object of one class to act like it is object of another class
hiding an access to data
powerful technique to store all data together
Qucksort is implemented recursively
Waiting line of people is similar to which data structure?
Queue
LinkedList
Stack
Tree
Graph
Which of the graph implementations is more simple?
Matrix
map
set
list
To use Binary Search items should be ...
ordereed
matched
divorced
traversed
beaten
Reference "rear" of CircularArray is usually indicates ...
last added item
first added item
secondly added item
middle of array
top of a stack
If there is no path path from vertex to any other vertex that graph is considered to be ?
unconnected
undirected
DFS
BFS
weighted
Can we implement the queue using LinkedList?
yes
no
i don't know
maybe
i need to learn more about this
What is not perfect in this code: ave = sum / count;
division by zero may occur
multiplication by 10000000 is impossible in JAVA
ave should be written as average
semicolon needed after =
it is not java code
Returns the reference to the element at position index
get(index)
has(index)
goTo(index)
fly(index)
set(index)
Indicate exponential time complexity in terms of big-O notation?
O(2^n)
O(logn)
O(n^4)
O(nlogn)
O(n)
Traversing graph visiting a start node first, then all nodes that are adjacent to it next.
DIjkstra
matrix
preorder
A ________ graph is one where [E] is much less than [V]^2.
sprase
dense
path
hence
directed
Which method returns an object at the top of a Stack in JAVA?
peek()
front()
top()
pop()
poll()
The ____________ algorithm finds minimum spanning tree for a graph.
prim
Dijkstra
traverese left subtree, Visit root node, traverse right subtree traversal is called?
inorder
postorder
Data structure based on BST where all items are sorted and unique is?
treeSet
tree
treeMap
vector
graph
Graph is considered to be ___________ if there is a path from each vertex to any other vertex.
connected
unweighted
What is the difference between ArrayList and Vector?
Vector is synchronized where ArrayList is not
There is no difference
vector is resizable where ArrayList is not
vector is flexible where ArrayList is not
vector is scalable where ArrayList is not
Visit root node, traverese left subtree, traverse right subtree traversal is called?
First in last out structure is ...
stack
queue
Which container is not appropriate to implement Stack in Java?
array
Average time complexity of Bubble sort is?
O(n^2)
O(1)
O(n^3)
Every class has __________ as a superclass.
object
main
string
java
subject
traverse left subtree, traverse right subtree, visit root node traversal is called ?
A ___________ tree is a binary tree used to store a code that facilitates file compression.
Huffman
heap
Distance from the root to its deepest leaf is known as __________ of a tree?
depth
height
subtree
root
The node of a tree without children is called ... ?
leaf
sibling
Which structure is better to use when printing many documents from multiple computers at one printer?
A collision occurs when ... ?
two keys hash to the same table index.
i don't know what it is
impossible to answer
two keys are hashed to a very big table index and rehash needed
two values hash to the same table index
A __________ graph is one in which [E] is close to but less than [V]^2.
dark
Average time complexity of Merge sort is?
The _________ is used to implement the special kind of a queue called priority queue.
BST
deap
Average time complexity of Shell sort is?
O(n^1.25)
If there is at least one abstract method in a class, that class is called ...
abstract class
vanish class
tired class
recursive class
general class
Finding the shortest path algorithm is called?
Binary Search
Which part is accessible to user?
public
private
protected
interacted
social
Dijkstra's algorithm use ______ algorithm to traverse all nodes.
Prime's
A list can _________ or _________ as elements added or removed.
grow, shrink
increase, grow
fly, sit
decrease, think
flow, shrink
What is the time complexity of recursive Binary Search algorithm?
O(NxM)
Why do we need BFS and DFS algorithms?
to traverse a graph
to measure graphh
to remove an item from graph
to find the way
to add new item in a graph
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.
quick
merge
selection
bubble
Show the method which exists in DoubleLinkedList and not exist in SingleLinkedList?
previous()
next()
constructor
hasBefore()
hasNext()
What determines whether you should use quadratic sort or a logarithmic sort algorithm?
array size
array values
swapping conditions
array type
array index
The Collection is a _________ of a List
superinterface
node
interface
parent
father
The _________ level of a node is a measure of its distance from the root.
level
distance
A queue _________ in ___________ out data structure.
first, first
set,get
last,last
first,last
last,first
for(int i=0; i< size; i++){ if(theData[i]==entry){ return i; } return -1; } This method is similar to which method of ArrayList?
indexOf(entry)
get(entry)
equals(entry)
set(entry)
______________ exception is an error normally not due to programmer.
checked
unchecked
cracked
hacked
______________ exception is an error normally due to programmer.
Distance from the deepest leaf to the root of a tree is called?
breadth
ListIterator and Iterator is the same thing in JAVA.
The function that calls itself is called ...
recursive function
functional function
defensive function
impressive function
If you want to call different constructor of current class you would use ...
this()
this.
super.
super()
Which method adds an item on the top of the Stack in JAVA?
push()
add()
In open addressing you can not remove an item to be deleted, so what should you do instead?
mark as deleted flag
go home and dance
delete and save in temporary list
change its place with another item
do nothing
What is the best time complexity of recursively finding fibbonachi nuber?
H2O
A __________ is a sequence of vertices in which each successive vertex is connected to its predecessor. (Graphs)
route
cycle
weight
Searching a binary search tree costs?
Average time complexity of Selection sort is?
Full name of this course is ?
Algorithms and Data Structures
SDP4
Programming with Java
Basic circuit theory
Algoritmization and programming language
In ___________ graph is {v, u} is edge then {u, v} is not necessary an edge.
Average time complexity of Quick sort is?
Ideal data structure for a contact list is ?
Each recursive function has two cases ________ and _________.
base, recursive
continued, stopped
looped, switched
lelik, bolik
base,defensive
Array reallocation cost is ______?
It is possible to implement all recursive algorithms without recursion
Set of connections between vertices of a graph is called?
edge
vertex
roof
cycle path
Hiding access to data members of a class is called ...
Encapsulation
Overloading
Overriding
Inheritance
Polymorphism
Using a hash table enables us to retrive an item in a __________ time.
constant
linear
average
nlogn
logarithmic
Is it possible to implement multiple interfaces?
Sets the element on position index to reference entry
set(index, entry)
entry.set(index)
index.set(entry)
setTo(index, entry)
set.index(entry)
Which of the graph implementation is more efficient in terms of memory usage?
In the queue implemented as a LinkedList, poll() function should ...
remove first added item
remove last added item
play with items
remove middle item
add new item
Which function is used to add new item in the queue?
offer()
suffer()
remove()
Recursive solutions are more beautiful and easy to understand.
Which structure is widely used to calculate the value of postfix expression?
Array
Set
String
This returns true if the collection contains obj.
contains(obj)
goTO(obj)
indexF(obj)
find(obj)
indexOf(obj)
Redefinition of the method of superclass in a subclass with the same name and number of parameters is...
override
overload
overbeat
overhead
upperload
If you want to call the constructor of superclass you would use ...
constructor()
Element insertion to a Binary Search tree costs?
O(f(n))
What is the time complexity of adding an item in front of a LinkedList?
The collection of abstract methods is called?
function
class
method
This method returns a string that textually represents an object.
toString()
toGo()
toText()
equals()
hashCode()
Graph where each edge has a direction is called?
wayed
mapped
strong
stricted
Which of the following is not example of visibility in JAVA.
Eclipsed
Public
Private
Protected
Package
A tree where left child is less and right child is more than its parent called?
Binary Search Tree
Binary tree
Huffman tree
Breadth first search
How to handle exceptions
try{}catch(){}
try{}batch(){}
fly{}catch(){}
poimai{}menya{}esli{}smozhesh()
go{}home()
Is it possible to inherit from multiple classes?
Vertex is ________ to another vertex if there is an edge connecting them.
adjacent
brotherhood
DIJkstra
If two or more keys will be encoded to the same index of a hashtable, it is called.
collision
duplicate
decision
error
mistake
Returns entry at the front of a Deque without removing it
peekFirst()
pollFirst()
popFirst()
takeFirst()
Complete binary tree where all children must be bigger than parents is ?
minheap
maxheap
fullheap
hiphop
treeheap
Which function return first added item in the queue?
element ()
giveMeFirst
goBack()
first()
Gets the size of the ArrayList
size()
sizeOf()
length(list)
size(list)
length
Traversing graph visiting a start node first, then choose one node that is adjacent to it next.
The relationship when one class is a subclass of another is called ...
is-a
has-a
to-c
is-b
has-b
Recursive nonlinear data structure that is used to represent data organized in a hirarchy?
arrayList
linkedList
Which of them is not an example of Data Structure
Breadth First Search
ArrayList
Priority Queue
Two JAVA API implementation of Set and Map are:
tree and hash
graph and tree
list and hash
graph and vector
tree and list
Which of them is not a feature of Collection Interface?
Indicate two ways of graph implementations
list and matrix
set and map
array and vector
queue and stack
Indicate logarithmic time complexity in terms of big-O notation?
O(2)
O(done)
What are the two parts of ADT?
Private and Public
ArrayList and Vector
Parent and Child
Int and Float
Queue and Stack
public xxx(int index){ return theData[index]; } this behaviour is similar to which method of ArrayList class?
get
equals
size
goHome
Indicate the relationship of HashtableOpen and Entry classes?
static
Which method removes an item on the top of a Stack in JAVA?
hop()
drop()
How to remove item from LinkedList?
change link of prev item to next item of item to be removed
go home and cry
change link of next item to prev item of item to be removed
change link of removing item to prev
change link of remobingitem to next
Find the slowest time
O(n!)
O(100)
Node of a graph is called?
dijkstra
calculate the value of "4 7 * 20 -"
8
136
3
144
1
Complete binary tree where all children must be smaller than parents is ?
The relationship when one class is defined inside the definition of another is called...
Prim's algorithm is used to calculate __________.
the minimum spanning tree of a graph
cyclic path
direction path
Which of them has more methods?
subclass
superclass
A ___________ of a node is a tree whose root is a child of that node.
child
Structured set of data is called _______.
data structure
set of data
algorithm
data pattern
design of data
Circular Array is usually used to implement ...
shreck
int xxx(int x){ if(n==1) return 1; return x*xxx(x-1); } this function calculates
n!
fibbonachi
x^n
2^n
x/n
JAVA API uses ____________ to implement both Set and Map interfaces.
hash table
tree table
arraylist
Average time complexity of Insertion sort is?
What is the time complexity of ArrayList remove(index) method?
O(nxn)
Does binary search tree contain duplicates?
i have to go
for (i<n) if (a[i] == item) return i; This algotithm is similar to ...
linear search
deep sort
heap sort
binary search
merge sort
Would an operating system use stack or queue to determine which print job should be handled next?
What is popularly used to traverse SingleLinkedList?
iterator
loop and switch
commutator
traversator
Quadratic probing is usually used to ?
reduce collisions
enlarge table size
reallocate array
for fun
calculate x^2
To apply Dijkstra's algorithm graph should be.
isomorphic
cyclic
Inventor of merge sort is ?
John von Neumann
John Lennon
Van der Sar
Mr Merge
Professor Sortmerg
instanceof used to test ...
whether an object belongs to class or not
weather object has parent or nor
weather is is the biggest object
weather object is object or not
weather objectplays football or not
Most sorting algorithm are divided into two basic groups.
fast and slow
sort and search
best and worst
go and play
ordered and unordered
Attempt to convert a string that is not numeric to a number faults ...
NumberFormatException
ArithmeticException
DoNotSpeakException
SDP4IsNotSubjectException
BadProgrammerException
Average time complexity of Heap sort is?
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.
Data structure similar to tree but it doesn't have limitation according to number of parents is?
treeset
dequeue
Set of ordered pairs whose element are known as the key and value is ?
too easy for me
Ability of object of one class to act like it is an object of another class is?
Java code
SLOC(Source line of code)
A ________ is a special cas of a graph. A ________ is a connected graph that contain no cycles.
tree,tree
matrix,list
set,map
BFS,DFS
tree,hash
What relationship class Node and LinkedList have?
Which of the following is recursive algorithm?
quicksort
selectionsort
insertionsort
bubblesort
all of them are recursive
Can we access the element of a set by index?
List two ways of organizing hashtable.
open addressing and chaining
breadth first search and depth first search
key and value
arraylist and vector
prime's and dijkstra
This method of a binary tree class return true if tree is a leaf and false otherwise?
isLeaf()
isEmpty()
noMore()
isLast()
goHome()
ADT that enables a user to access information (data) corresponding to a specified key.
led
An ordered set of instructions is called.
hello world
pseudocode
OOP stands for?
Object oriented programming
Omar oriented programming
Object oriented playing
Obstacle oriented programming
OOP is the keyword of Java programming and stands for nothing
Is it possible to traverse contaning of a list this way? for( int nextInt : aList ){ ... }
Which structure is widely used in finding palindrome problem?
Adding an item to the beginning of CircularArray costs?
7 iterations
What is the attribute of CircularList?
Next of last item referencing to the first item
Next of best item referencing to the worst item
Next of first item referencing to the last item
I need to go home and prepare for this
Prev of last item referencing to last item
Attempt to access array element using index less than 0 faults ...
ArrayIndexOutOfBoundsException
InputMismatchException
MCDonerException
GoHomeException
What does method empty return for empty stack?
true
false
nothing
empty
hello
Elements of a List are accessed by means of an __________
index
position
loop
switch
book
If we call remove() function for the queue, which item will be removed?
first
second
middle
third
last
This method associates specified value with the specified key in the map.
put(key, value)
set(key, value)
get(key, value)
associate(key, value)
key.set(value)
Indicate linear time complexity in terms of big-O notation?
O(loglogn)
A tree where all nodes should have 2 children and leaves have no children is called?
full binary tree
binary tree
unary tree
general tree
Insert and remove items from a heap costs?
What is the time complexity of adding element in the beginning of ArrayList?
O(25)
Adjacent matrix representing undirected graph should be?
symmetric
triangular
diagonal
orthognal
Which of the following in java is very similar to "contract"?
Interface implementation
Class overriding
Class inheritance
Dancing in a queue
Method overloading
Where new item added in the queue?
to the end
position chosen randomly
in the middle
in the beginning
it is impossible to add new item in the queue
Which method searches for target and returns its position in LinkedList?
indexOf(target)
get(target)
set(target)
go(target)
equal(target)
A ___________ path is a simple path in which only the first and last items are the same.
tour
trip
looped
sticked
Redefinition of method with the same name but different number of parameters is called...
inheritance
polymorphism
encapsulation
Recursive implementation works faster than lopped one.
If there are no abstract methods in the class we call that class ...
Actual Class
Abstract Class
Non abstract Class
Super Class
Funny Class
Which part is not accessible to user?
Based
Controlled
Shifted
What is the time complexity of insert(index) method in ArrayList
What is the feature of Deque?
cheap element addition and removal from the beginning
cheap element addition and removal from the end
cheap element addition and removal from the middle
removal
addition
overloaded function
int xxx(int x, int y, int z){ if(z==1){return 1;} return xxx(x+y, x, z-1); } this function is
Fibbonachi
it is trash function
What is the time complexity of Linear Search algorithm?
siblin
Tree where every item must have at most 2 children is called?
Binary Tree
General Tree
Huffman Tree
Generic Tree
Unary Tree
What is the benefit of encoding letters trough Huffman tree.
earning space
more beautiful
just for fun
it is simple
it is smart
A set view of a map can be obtained through method_______?
entrySet
emptySet
setView
viewAsSet
goAhead
You apply method ____________ to set view to get an object that facilitates sequential access to the Map elements.
accessor
traversal
posorder
If you want to call data member of superclass you would use ...
In a Huffman tree, the item with the lowest frequency of occurrence will have the ___________ code.
shortest
deepest
longest
easiest
binary
A Stack is __________ in _________ out data structure.
first,first
back, top
end,end
front,front