Computer Knowledge
Data Structures and Algorithms
1,256 Questions
Data Structures and Algorithms form the core of computer science, focusing on arrays, linked lists, trees, and sorting mechanisms. These concepts are essential for solving complex computational problems efficiently. Test takers preparing for technical and administrative IT exams will find these questions highly relevant.
Array OperationsLinked List ApplicationsSorting AlgorithmsTree Data StructuresMultilevel IndexingAlgorithm Time Complexity
Data Structures and Algorithms Questions
-
leaf
-
root
-
first node of left sub tree
-
first node of right sub tree
-
O(logn)
-
O(d)
-
O(2d)
-
None of the above
-
O(1)
-
O(log(n))
-
O(n)
-
O(n/2)
-
O(n2)
-
O(n3)
-
O(nlogn)
-
O(2n)
-
bubble sort
-
polynomial manipulation
-
binary search
-
merge sort
-
radix sort
C
Correct answer
Explanation
Binary search needs sorting of arrays and the sorting using data structure link list is very complex. Hence, it is not suitable.
-
priority queues
-
binary trees
-
linked lists
-
stacks
-
All of the above
A
Correct answer
Explanation
In heap, the most important node is stored at the top position. If it gets deleted, the second most important node replaces it. It is a similar concept as priority queue.
-
Merge sort
-
Quick sort
-
Bubble sort
-
Sink sort
-
Radix sort
B
Correct answer
Explanation
Quick sort technique involves choosing a central element which is used to partition data according to the value. Then, both sets are individually processed by continuous partitioning and the required order is obtained.
-
one-dimensional array
-
sparse array
-
constant array
-
homogeneous array
-
parse array
B
Correct answer
Explanation
Sparse array is an array which assigns a default value to all its element. It may be a constant or null.
-
((((a+i)+j)+k)+l)
-
a+i+j+k+l
-
((((**** a+i)+j)+k)+l)
-
((((a+i)+j)+k)+l)
-
None of these
A
Correct answer
Explanation
a[i] can be written as *(a+i), therefore a[i][j][k][l] can be written as given in the option.
-
LIFO
-
FIFO
-
parallel fashion
-
All of the above
-
None of these
A
Correct answer
Explanation
A recursive function uses the stack.
-
Cause elimination
-
Backtracking
-
Brute force
-
Security testing
-
Verification
A
Correct answer
Explanation
It is manifested by induction or deduction and introduces the concept of binary partitioning.
-
Pfam
-
ProDom
-
MUMmer
-
KEGG
-
TIGRFAMs
C
Correct answer
Explanation
MUMmer is a bioinformatics software system for sequence alignment. It is based on the suffix tree data structure and is one of the fastest and most efficient systems available for this task, enabling it to be applied to very long sequences.
-
Queue
-
Stack
-
Tree
-
Heap
-
List
B
Correct answer
Explanation
A stack is a particular kind of abstract data type or collection in which the principal (or only) operations on the collection are the addition of an entity to the collection, known as push and removal of an entity, known as pop. The relation between the push and pop operations is such that the stack is a Last-In-First-Out (LIFO) data structure. It is the best data for checking the balancing of parenthesis.
-
Sequential pattern
-
Clustering / segmentation
-
Association
-
EIther Sequential pattern or Clustering / segmentation
-
None of these
C
Correct answer
Explanation
An association function is an operation against this set of records, which returns affinities or patterns that exists among the collection of items.
-
$\theta(n^2)$
-
$\theta(nlogn)$
-
$\theta(n)$
-
$\theta(logn)^2$
A
Correct answer
Explanation
To solve this question, the user needs to know the concept of time complexity and how to analyze the time complexity of a given algorithm.
The given function fun() contains two nested loops that iterate over the range of n and j respectively. The outer loop runs n times, and the inner loop runs from i to 1. Therefore, the total number of iterations is the sum of the first n positive integers, which is n*(n+1)/2.
Since the number of iterations is proportional to n^2, the time complexity of the function is $\theta(n^2)$.
Therefore, the correct answer is:
The Answer is: A. $\theta(n^2)$