Data Structures and File Management
Data Structures and File Management
4) Visiting root node after visiting left and right sub-trees is called
A - In-order Traversal B - Pre-order Traversal C - Post-order Traversal
5) The number of binary trees with 3 nodes which when traversed in post order gives the
sequence A,B,C is ?
A 3 B 4 C 5 D 6
7) Heap is an example of
A - complete binary tree B - spanning tree
C - sparse tree D - binary search tree
10) For a binary search algorithm to work, it is necessary that the array (list) must be
A – sorted B – unsorted C - in a heap D - popped out of stack
11) What data structure is used for depth first traversal of a graph?
A – queue B – stack C – list D - none of the above
15) Which of the below given sorting techniques has highest best-case runtime complexity −
1|Page
A - quick sort B - selection sort C - insertion sort D - bubble sort
16) Which of the following is not possible with an array in C programming language −
A – Declaration B – Definition C - Dynamic Allocation D - Array of strings
19) The following formula is of: left_subtree(keys) <= node(key) <= right_subtree(key)
A - Binary Tree B - Complete Binary Tree
C - Binary Search Tree D - All of the above
20) The minimum number of edges required to create a cyclic graph of n vertices is
A–n B-n–1 C-n+1 D - 2n
22) Which of the below mentioned sorting algorithms are not stable?
A - Selection Sort B - Bubble Sort C - Merge Sort D - Insertion Sort
25) If the data collection is in sorted form and equally distributed then the run time
complexity of interpolation search is −
A - Ο(n) B - Ο(1) C - Ο(log n) D - Ο(log (log n))
2|Page
31) Which of the following is not possible with an array in C programming language −
A – Declaration B – Definition
C - Dynamic Allocation D - Array of strings
41) In a min-heap:
A - parent nodes have values greater than or equal to their children
B - parent nodes have values less than or equal to their children
C - both statements are true
D - both statements are wrong
43) Visiting right sub-tree node after visiting left sub-tree followed by the root is called
3|Page
A - In-order Traversal B - Pre-order Traversal C - Post-order Traversal
44) In binary heap, whenever the root is removed then the rightmost element of last level is
replaced by the root. Why?
A - It is the easiest possible way.
B - To make sure that it is still complete binary tree.
C - Because left and right sub-tree might be missing.
D - None of the above!
49) What is the worst case run-time complexity of binary search algorithm?
A - Ο(n2) B - Ο(nlog n) C - Ο(n3) D – O(n)
50) What data structure can be used to check if a syntax has balanced parentheses?
A – queue B – tree C – list D - Stack
52) If the array is already sorted, which of these algorithms will exhibit the best performance
A - Merge Sort B - Insertion Sort C - Quick Sort D - Heap Sort
4|Page
C - B but not A D - Both A & B
56) Interpolation search is an improved variant of binary search. It is necessary for this
search algorithm to work that −
A - data collection should be in sorted form and equally distributed.
B - data collection should be in sorted form and but not equally distributed.
C - data collection should be equally distributed but not sorted.
D - None of the above.
57) What is the worst case time complexity of linear search algorithm?
A - Ο(1) B - Ο(n) C - Ο(log n) D - Ο(n2)
58) An algorithm is
A - a piece of code to be executed.
B - a loosely written code to make final code.
C - a step by step procedure to solve problem.
D - all of the above.
59) Which of the below given sorting techniques has highest best-case runtime complexity −
A - quick sort B - selection sort C - insertion sort D - bubble sort
A- collision resolution
B- address space resolution
C- multiple hashing resolution
D- chaining resolution
63) The record searching technique in which the searching of records is done by block
by block is classified as
A- heap search
5|Page
B- non linear search
C- linear search
D- relative search
64) In the disk packs, the tracks are divided into smaller block of information
containing large amount of information called
A- blocks
B- cylinder
C- sector
D- all of above
65) In high level programs, the command which is used to prepare the file for writing
and reading is classified as
A- modify command
B- open command
C- locate command
D- reset command
66) The technique of writing data on two physical disks and treating both disks as one
logical disk unit is classified as
A- shadowing
B- clustering
C- distributing
D- non shadowing
67) Considering storage capacity, the one billion bytes of data are equal to
A- 1 kilo bytes
B- 1 tera bytes
C- 1 mega bytes
D- 1 gega bytes
68) The circles in a disk in which the information is stored are called
A- track
B- cylinder
C- sector
D- blocks
69) If the file load factor is 0.6, blocking factor is 25 and the number of file buckets
are 5 then the current number of records are
A- 95
6|Page
B- 65
C- 75
D- 85
70) If the global depth in extendible hashing is equal to local depth then the operation
must be performed in directory array is
A- adding
B- subtracting
C- halving
D- doubling
71) In external hashing for files of disk, the pointers which contain record position
and block address within the block are classified as
A- position pointers
B- address pointers
C- block pointers
D- record pointers
72) The technique which involves the arithmetic function or logical function is
classified as
A- clustering technique
B- folding technique
C- spanning technique
D- hashing technique
A- overflow file
B- heap file
C- sequential file
D- spanned file
74) In high level programs, the command which is used to copy the current record
from buffer to variable of user program is classified as
A- read command
B- find next command
C- modify command
D- insert command
75) In disks, the tracks having same diameter on different surfaces are classified as
A- sector
7|Page
B- blocks
C- track
D- cylinder
76) In high level programs, the command which sets the pointer of file to the
beginning of that file is classified as
A- modify command
B- open command
C- locate command
D- reset command
77) The time required to position write or read track on correct place is classified as
A- reel time
B- seek time
C- rotational delay
D- transfer time of block
78) Considering storage capacity, the 2000 bytes of data are equal to
A- 1 tera bytes
B- 2 kilobytes
C- 1 mega bytes
D- 2 mega bytes
79) The concept in which extra bit or byte is stored for record deletion and that extra
stored bit is called
A- insertion marker
B- deletion marker
C- modifying marker
D- static marker
A- preserving hashing
B- external hashing
C- internal hashing
D- reversal hashing
81) The fields which are used to retrieve the related records from other files are called
A- secondary fields
B- primary fields
C- key fields
8|Page
D- connecting fields
82) The command in DBMS software which is used to locate records that fulfills the
search condition is classified as
83) Considering the disks, the command with which the buffer is copied into the
block of disk is classified as
A- write command
B- read command
C- paste command
D- cut command
A- dynamic hashing
B- extendible hashing
C- non extendible hashing
D- static hashing
86) The type of organization in which the records are inserted at the end of stored file
is classified as
A- pile file
B- linear search file
C- relative file
D- external file
87) The kind of field with which the record searching is done is classified as
A- sorting field
B- relative field
C- linear field
9|Page
D- ordering field
A- magnetic disks
B- optical disks
C- removable media
D- cache memory
89) a disk units which has an actuator attached into it are called
A- transfer disks
B- mechanical disks
C- moveable-head disks
D- fixed-head disks
96) The organization and management of data structures take place in:
(a) Primary Memory (b) Secondary Memory
(c) External Memory (d) Primary & Secondary Memory
97) In an expression binary tree, to obtain the postfix form of the expression we
10 | P a g e
traverse in:
(a) Pre order (b) Post order
(c) In order (d) Pre and Post order both
98) Suppose you have a directed graph representing all the flights that an airline flies.
What algorithm might be used to find the best sequence of connections from one
city to another?
(a) Breadth first search. (b) Depth first search.
(c) A cycle-finding algorithm. (d) A shortest-path algorithm.
100) Consider A and B as two operands, and “ +” as the operator, the presentation
A + B is called:
(a) prefix (b) postfix
(c) infix (d) suffix
11 | P a g e
Section B
Constant O(1)
Logarithmic O(log n)
Linear O(n)
n log n O(n log n)
Quadratic O(n)
Cubic O(n3)
n). Write the Prefix, Infix and Postfix notation from the expression tree.
o). Briefly define Parent, Path, Leaf
P). KNOW Basic operations that can be performed on a binary search tree.
q). Traverse the given tree using In-order, Pre-order and Post-order traversals.
12 | P a g e