Professional Documents
Culture Documents
Algorithms
(Prelim Exam)
Made By (DARKX)
Highest grade: 80.00 / 100.00.
ANSWER: queue
It contains an element field to store an element value, and a next field to store a pointer to the
next node on the list.
ANSWER: Link class (WRONG) Try / Data (WRONG) Try / Data element
In building linked list, it needs three pointers to build: one to point to the first node in the list,
one to point to the last node and one to create the new one.
ANSWER: True
ANSWER: ADT
It is a linear data structures that can accessed, store and removed at one end.
ANSWER: stack
Returns the last element in the queue.
ANSWER: back() (WRONG) Try / None of the above (WRONG) Try / T& back()
ANSWER: False
ANSWER: clear ()
A data structure requires a large amount of space for each data item stores and a large amount
of time to perform a single operation and a certain amount of programming effort.
ANSWER: False
ANSWER: True
ANSWER: isEmpty()
It is a collection of values.
ANSWER: stack
ANSWER: pop
ANSWER: False
List nodes has a single pointer to the next node on the list.
It is a mathematical model for a certain class of data structure that has similar behavior.
This queue operation takes the first element from the queue.
ANSWER: dequeue()
ANSWER: clear()
ANSWER: queue()
ANSWER: True
It is a collection of nodes wherein every node contains the address of the next node.
After removing the first element from the queue of 10 5 15 7. Which element will be the first
element?
It is simply as a waiting line that grows by adding an elements to its end and shrinks by taking
elements from its front.
ANSWER: queue
ANSWER: True
10 5 15 7. Which element will be remove from the queue?
ANSWER: Array
It is a list of items.
ANSWER: True
ANSWER: true
ANSWER: push
This linked list operation determines whether a particular item is in the list.
ANSWER: Search
ANSWER: TOP
ANSWER: List
A pointer variable which contains the location at the top element of the stack.
ANSWER: TOP
ANSWER: AVAIL
The term used to insert an element into stack.
ANSWER: push
ANSWER: Sentinel
ANSWER: Pop
ANSWER: traversal
ANSWER: None of the above (WRONG) Try / size_type() (WRONG) Try / size_type
size() cost
The complexity of sorting algorithm measures the __________ as a function of the number n of
items to be shorter.
ANSWER: Item is the last element in the array or item is not there at all
_____________ order is the best possible for array sorting algorithm which sorts n item.
ANSWER: O(n+logn)
ANSWER: O(n)
___________ sorting algorithm is frequently used when n is small, where n is the total number of
elements.
ANSWER: Insertion
Which of the following is not the required condition for binary search algorithm?
i. Internal sorting are applied when the entire collection if data to be sorted is small enough that
the sorting can take place within main memory.
ii. The time required to read or write is considered significant in evaluating the performance of
internal sorting.
This is a binary tree whose every node has either zero or two children.
ANSWER: Dn = log2n+1
ANSWER: Leaf
Graph G is _____________ if for any pair u, v of nodes in G, there is a path from u to v or path from
v to u.
ANSWER: Digraph
ANSWER: Trees
It is a pair of nodes.
It is a binary tree that stores a collection of elements with their associated keys at its nodes.
ANSWER: heap
Merge sort combines the two sorted sublists into one sorted list.
ANSWER: True
ANSWER: empty()
This graph operation stores the graph in computer memory.
ANSWER: graph (WRONG) Try / none of the above (WRONG) Try / create the graph
ANSWER: tree
ANSWER: p.left()
ANSWER: empty()
ANSWER: graph
It allows you to store elements so they can be located quickly using keys.
ANSWER: tree
ANSWER: entries() (WRONG) Try / number() (WRONG) Try / None of the above
ANSWER: p.children()
A binary tree function that removes the last node of the tree and return its element
ANSWER: remove()
ANSWER: Empty graph (WRONG) Try / Empty (WRONG) Try / Clear the graph
ANSWER: False
It is similar to preorder traversal of a binary tree.
The list is partitioned and combining the sorted lowerSublist and upperSublist is trivial.
ANSWER: quicksort
ANSWER: True
A list is sorted by selecting elements in the list, one at a time, and moving them to their proper
positions.
ANSWER: p.parent()
In a tree structure, has a parent element and zero or more children elements.
ANSWER: True
ANSWER: True
It uses divide-and-conquer technique to sort a list by partitioning the list into two sublists.
ANSWER: root()
These are used to model electrical circuits, chemical compounds and highway maps.
ANSWER: graphs
What is the first sublist of the following sets of number
10 18 17 15 21 34 36 32 33 37
[1]
ANSWER:
In an undirected graph, edges are drawn using lines.
ANSWER: False
ANSWER: begin()
A linear list in which the pointer points only to the successive node.
ANSWER: Reverse
This form of access is used to add and remove nodes from a queue.
ANSWER: 0
ANSWER: Back
The situation when in a linked list START=NULL is ____________________.
ANSWER: Underflow
ANSWER: for the size of the structure and the data in the structure are constantly
changing