Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 16

Data structure

1. Which data structure allows deleting data elements from front and inserting at rear?
a. Stacks
b. Queues
c. Deques
d. Binary search tree
2. dentify the data structure which allows deletions at both ends of the list but insertion
at only one end.
a. n!ut"restricted deque
b. #ut!ut"restricted deque
c. $riority queues
d. %one of abo&e
'. Which of the following data structure is non"linear ty!e?
a. Strings
b. (ists
c. Stacks
d. %one of abo&e
). Which of the following data structure is linear ty!e?
a. Strings
b. (ists
c. Queues
d. *ll of abo&e
+. ,o re!resent hierarchical relationshi! between elements- which data structure is
suitable?
a. Deque
b. $riority
c. ,ree
d. *ll of abo&e
.. * binary tree whose e&ery node has either /ero or two children is called
a. 0om!lete binary tree
b. Binary search tree
c. 12tended binary tree
d. %one of abo&e
3. ,he de!th of a com!lete binary tree is gi&en by
a. Dn 4 n log2n
b. Dn 4 n log2n51
c. Dn 4 log2n
d. Dn 4 log2n51
6. When re!resenting any algebraic e2!ression 1 which uses only binary o!erations in a
2"tree-
a. the &ariable in 1 will a!!ear as e2ternal nodes and o!erations in internal nodes
b. the o!erations in 1 will a!!ear as e2ternal nodes and &ariables in internal nodes
c. the &ariables and o!erations in 1 will a!!ear only in internal nodes
d. the &ariables and o!erations in 1 will a!!ear only in e2ternal nodes
7. * binary tree can easily be con&erted into q 2"tree
a. by re!lacing each em!ty sub tree by a new internal node
b. by inserting an internal nodes for non"em!ty node
c. by inserting an e2ternal nodes for non"em!ty node
d. by re!lacing each em!ty sub tree by a new e2ternal node
18. When con&erting binary tree into e2tended binary tree- all the original nodes in
binary tree are
a. internal nodes on e2tended tree
b. e2ternal nodes on e2tended tree
c. &anished on e2tended tree
d. %one of abo&e
11. ,he !ost order tra&ersal of a binary tree is D1B90*. 9ind out the !re order tra&ersal
a. *B90D1
b. *DB910
c. *BD109
d. *BD019
12. Which of the following sorting algorithm is of di&ide"and"conquer ty!e?
a. Bubble sort
b. nsertion sort
c. Quick sort
d. *ll of abo&e
1'. *n algorithm that calls itself directly or indirectly is known as
a. Sub algorithm
b. :ecursion
c. $olish notation
d. ,ra&ersal algorithm
1). n a binary tree- certain null entries are re!laced by s!ecial !ointers which !oint to
nodes higher in the tree for efficiency. ,hese s!ecial !ointers are called
a. (eaf
b. branch
c. !ath
d. thread
1+. ,he in order tra&ersal of tree will yield a sorted listing of elements of tree in
a. Binary trees
b. Binary search trees
c. ;ea!s
d. %one of abo&e
1.. n a ;ea! tree
a. <alues in a node is greater than e&ery &alue in left sub tree and smaller than right sub
tree
b. <alues in a node is greater than e&ery &alue in children of it
c. Both of abo&e conditions a!!lies
d. %one of abo&e conditions a!!lies
13. n a gra!h if e4=u- &>- ,hen u and & are called
a. end!oints of e
b. ad?acent nodes
c. neighbors
d. all of abo&e
16. * connected gra!h , without any cycles is called
a. a tree gra!h
b. free tree
c. a tree
d. *ll of abo&e
17. n a gra!h if e4@u- &A means
a. u is ad?acent to & but & is not ad?acent to u
b. e begins at u and ends at &
c. u is !rocessor and & is successor
d. both b and c
28. f e&ery node u in B is ad?acent to e&ery other node & in B- * gra!h is said to be
a. isolated
b. com!lete
c. finite
d. strongly connected

Answers:

1. Which data structure allows deleting data elements from front and inserting at rear?
b. Queues
2. dentify the data structure which allows deletions at both ends of the list but insertion
at only one end.
a. n!ut"restricted deque
'. Which of the following data structure is non"linear ty!e?
d. %one of abo&e
). Which of the following data structure is linear ty!e?
d. *ll of abo&e
+. ,o re!resent hierarchical relationshi! between elements- which data structure is
suitable?
c. ,ree
.. * binary tree whose e&ery node has either /ero or two children is called
c. 12tended binary tree
3. ,he de!th of a com!lete binary tree is gi&en by
d. Dn 4 log2n 5 1
6. When re!resenting any algebraic e2!ression 1 which uses only binary o!erations in a
2"tree-
a. the &ariable in 1 will a!!ear as e2ternal nodes and o!erations in internal nodes
7. * binary tree can easily be con&erted into q 2"tree
d. by re!lacing each em!ty sub tree by a new e2ternal node
18. When con&erting binary tree into e2tended binary tree- all the original nodes in
binary tree are
a. internal nodes on e2tended tree
11. ,he !ost order tra&ersal of a binary tree is D1B90*. 9ind out the !re order tra&ersal
c. *BD109
12. Which of the following sorting algorithm is of di&ide"and"conquer ty!e?
c. Quick sort
1'. *n algorithm that calls itself directly or indirectly is known as
b. :ecursion
1). n a binary tree- certain null entries are re!laced by s!ecial !ointers which !oint to
nodes higher in the tree for efficiency. ,hese s!ecial !ointers are called
d. thread
1+. ,he in order tra&ersal of tree will yield a sorted listing of elements of tree in
b. Binary search trees
1.. n a ;ea! tree
b. <alues in a node is greater than e&ery &alue in children of it
13. n a gra!h if e4=u- &>- ,hen u and & are called
d. all of abo&e
16. * connected gra!h , without any cycles is called
d. *ll of abo&e
17. n a gra!h if e4@u- &A means
d. both b and c
28. f e&ery node u in B is ad?acent to e&ery other node & in B- * gra!h is said to be
b. com!lete

QUESTION
1. ,he memory address of the first element of an array is called
a. floor address
b. foundation address
c. first address
d. base address

2. ,he memory address of fifth element of an array can be calculated by the formula
a. (#0@*rray=+>4Base@*rrayA5w@+"lower boundA- where w is the number of words !er
memory cell for the array
b. (#0@*rray=+>A4Base@*rray=+>A5@+"lower boundA- where w is the number of words !er
memory cell for the array
c. (#0@*rray=+>A4Base@*rray=)>A5@+"C!!er boundA- where w is the number of words
!er memory cell for the array
d. %one of abo&e

'. Which of the following data structures are inde2ed structures?
a. linear arrays
b. linked lists
c. both of abo&e
d. none of abo&e

). Which of the following is not the required condition for binary search algorithm?
a. ,he list must be sorted
b. there should be the direct access to the middle element in any sublist
c. ,here must be mechanism to delete andDor insert elements in list
d. none of abo&e

+. Which of the following is not a limitation of binary search algorithm?
a. must use a sorted array
b. requirement of sorted array is e2!ensi&e when a lot of insertion and deletions are
needed
c. there must be a mechanism to access middle element directly
d. binary search algorithm is not efficient when the data elements are more than 1888.

.. ,wo dimensional arrays are also called
a. tables arrays
b. matri2 arrays
c. both of abo&e
d. none of abo&e

3. * &ariable $ is called !ointer if
a. $ contains the address of an element in D*,*.
b. $ !oints to the address of first element in D*,*
c. $ can store only memory addresses
d. $ contain the D*,* and the address of D*,*

6. Which of the following data structure canEt store the non"homogeneous data elements?
a. *rrays
b. :ecords
c. $ointers
d. %one

7. Which of the following data structure store the homogeneous data elements?
a. *rrays
b. :ecords
c. $ointers
d. %one

18. 1ach data item in a record may be a grou! item com!osed of sub"itemsF those items
which are indecom!osable are called
a. elementary items
b. atoms
c. scalars
d. all of abo&e

11. ,he difference between linear array and a record is
a. *n array is suitable for homogeneous data but hte data items in a record may ha&e
different data ty!e
b. n a record- there may not be a natural ordering in o!!osed to linear array.
c. * record form a hierarchical structure but a lienear array does not
d. *ll of abo&e

12. Which of the following statement is false?
a. *rrays are dense lists and static data structure
b. data elements in linked list need not be stored in ad?ecent s!ace in memory
c. !ointers store the ne2t data element of a list
d. linked lists are collection of the nodes that contain information !art and ne2t !ointer

1'. Binary search algorithm can not be a!!lied to
a. sorted linked list
b. sorted binary trees
c. sorted linear array
d. !ointer array

1). When new data are to be inserted into a data structure- but there is no a&ailable s!aceF
this situation is usually called
a. underflow
b. o&erflow
c. housefull
d. saturated

1+. ,he situation when in a linked list S,*:,4%C(( is
a. underflow
b. o&erflow
c. housefull
d. saturated

1.. Which of the following is two way list?
a. grounded header list
b. circular header list
c. linked list with header and trailer nodes
d. none of abo&e

13. Which of the following name does not relate to stacks?
a. 99# lists
b. (9# list
c. $iles
d. $ush"down lists

16. ,he term G!ushG and G!o!G is related to the
a. array
b. lists
c. stacks
d. all of abo&e

17. * data structure where elements can be added or remo&ed at either end but not in the
middle
a. (inked lists
b. Stacks
c. Queues
d. Deque

28. When inorder tra&ersing a tree resulted 1 * 0 H 9 ; D B BF the !reorder tra&ersal
would return
a. 9*1H0DB;B
b. 9*1H0D;BB
c. 1*9H;D0BB
d. 91*HD0;BB

Answers

1. ,he memory address of the first element of an array is called
d. base address

2. ,he memory address of fifth element of an array can be calculated by the formula
a. (#0@*rray=+>4Base@*rrayA5w@+"lower boundA- where w is the number of words !er
memory cell for the array

'. Which of the following data structures are inde2ed structures?
a. linear arrays

). Which of the following is not the required condition for binary search algorithm?
c. ,here must be mechanism to delete andDor insert elements in list

+. Which of the following is not a limitation of binary search algorithm?
d. binary search algorithm is not efficient when the data elements are more than 1888.

.. ,wo dimensional arrays are also called
c. both of abo&e

3. * &ariable $ is called !ointer if
a. $ contains the address of an element in D*,*.

6. Which of the following data structure canEt store the non"homogeneous data elements?
a. *rrays

7. Which of the following data structure store the non"homogeneous data elements?
b. :ecords

18. 1ach data item in a record may be a grou! item com!osed of sub"itemsF those items
which are indecom!osable are called
d. all of abo&e

11. ,he difference between linear array and a record is
d. *ll of abo&e

12. Which of the following statement is false?
c. !ointers store the ne2t data element of a list

1'. Binary search algorithm can not be a!!lied to
a. sorted linked list

1). When new data are to be inserted into a data structure- but there is no a&ailable s!aceF
this situation is usually called
b. o&erflow

1+. ,he situation when in a linked list S,*:,4%C(( is
a. underflow

1.. Which of the following is two way list?
d. none of abo&e

13. Which of the following name does not relate to stacks?
a. 99# lists

16. ,he term G!ushG and G!o!G is related to the
c. stacks

17. * data structure where elements can be added or remo&ed at either end but not in the
middle
d. Deque

28. When inorder tra&ersing a tree resulted 1 * 0 H 9 ; D B BF the !reorder tra&ersal
would return
b. 9*1H0D;BB
QUESTION
1. ,wo main measures for the efficiency of an algorithm are
a. $rocessor and memory
b. 0om!le2ity and ca!acity
c. ,ime and s!ace
d. Data and s!ace

2. ,he time factor when determining the efficiency of algorithm is measured by
a. 0ounting microseconds
b. 0ounting the number of key o!erations
c. 0ounting the number of statements
d. 0ounting the kilobytes of algorithm

'. ,he s!ace factor when determining the efficiency of algorithm is measured by
a. 0ounting the ma2imum memory needed by the algorithm
b. 0ounting the minimum memory needed by the algorithm
c. 0ounting the a&erage memory needed by the algorithm
d. 0ounting the ma2imum disk s!ace needed by the algorithm

). Which of the following case does not e2ist in com!le2ity theory
a. Best case
b. Worst case
c. *&erage case
d. %ull case

+. ,he Worst case occur in linear search algorithm when
a. tem is somewhere in the middle of the array
b. tem is not in the array at all
c. tem is the last element in the array
d. tem is the last element in the array or is not there at all

.. ,he *&erage case occur in linear search algorithm
a. When tem is somewhere in the middle of the array
b. When tem is not in the array at all
c. When tem is the last element in the array
d. When tem is the last element in the array or is not there at all

3. ,he com!le2ity of the a&erage case of an algorithm is
a. Iuch more com!licated to analy/e than that of worst case
b. Iuch more sim!ler to analy/e than that of worst case
c. Sometimes more com!licated and some other times sim!ler than that of worst case
d. %one or abo&e

6. ,he com!le2ity of linear search algorithm is
a. #@nA
b. #@log nA
c. #@n2A
d. #@n log nA

7. ,he com!le2ity of Binary search algorithm is
a. #@nA
b. #@log A
c. #@n2A
d. #@n log nA

18. ,he com!le2ity of Bubble sort algorithm is
a. #@nA
b. #@log nA
c. #@n2A
d. #@n log nA

11. ,he com!le2ity of merge sort algorithm is
a. #@nA
b. #@log nA
c. #@n2A
d. #@n log nA

12. ,he indirect change of the &alues of a &ariable in one module by another module is
called
a. internal change
b. inter"module change
c. side effect
d. side"module u!date

1'. Which of the following data structure is not linear data structure?
a. *rrays
b. (inked lists
c. Both of abo&e
d. %one of abo&e

1). Which of the following data structure is linear data structure?
a. ,rees
b. Bra!hs
c. *rrays
d. %one of abo&e

1+. ,he o!eration of !rocessing each element in the list is known as
a. Sorting
b. Ierging
c. nserting
d. ,ra&ersal

1.. 9inding the location of the element with a gi&en &alue isJ
a. ,ra&ersal
b. Search
c. Sort
d. %one of abo&e

13. *rrays are best data structures
a. for relati&ely !ermanent collections of data
b. for the si/e of the structure and the data in the structure are constantly changing
c. for both of abo&e situation
d. for none of abo&e situation

16. (inked lists are best suited
a. for relati&ely !ermanent collections of data
b. for the si/e of the structure and the data in the structure are constantly changing
c. for both of abo&e situation
d. for none of abo&e situation

17. 1ach array declaration need not gi&e- im!licitly or e2!licitly- the information about
a. the name of array
b. the data ty!e of array
c. the first data from the set to be stored
d. the inde2 set of the array

28. ,he elements of an array are stored successi&ely in memory cells because
a. by this way com!uter can kee! track only the address of the first element and the
addresses of other elements can be calculated
b. the architecture of com!uter memory does not allow arrays to store other than serially
c. both of abo&e
d. none of abo&e
Answers

1. ,wo main measures for the efficiency of an algorithm are
c. ,ime and s!ace

2. ,he time factor when determining the efficiency of algorithm is measured by
b. 0ounting the number of key o!erations

'. ,he s!ace factor when determining the efficiency of algorithm is measured by
a. 0ounting the ma2imum memory needed by the algorithm

). Which of the following case does not e2ist in com!le2ity theory
d. %ull case

+. ,he Worst case occur in linear search algorithm when
d. tem is the last element in the array or is not there at all

.. ,he *&erage case occur in linear search algorithm
a. When tem is somewhere in the middle of the array

3. ,he com!le2ity of the a&erage case of an algorithm is
a. Iuch more com!licated to analy/e than that of worst case

6. ,he com!le2ity of linear search algorithm is
a. #@nA

7. ,he com!le2ity of Binary search algorithm is
b. #@log nA

18. ,he com!le2ity of Bubble sort algorithm is
c. #@n
2
A

11. ,he com!le2ity of merge sort algorithm is
d. #@n log nA

12. ,he indirect change of the &alues of a &ariable in one module by another module is
called
c. side effect

1'. Which of the following data structure is not linear data structure?
d. %one of abo&e

1). Which of the following data structure is linear data structure?
c. *rrays

1+. ,he o!eration of !rocessing each element in the list is known as
d. ,ra&ersal

1.. 9inding the location of the element with a gi&en &alue isJ
b. Search

13. *rrays are best data structures
a. for relati&ely !ermanent collections of data

16. (inked lists are best suited
b. for the si/e of the structure and the data in the structure are constantly changing

17. 1ach array declaration need not gi&e- im!licitly or e2!licitly- the information about
c. the first data from the set to be stored
28. ,he elements of an array are stored successi&ely in memory cells because
a. by this way com!uter can kee! track only the address of the first element and the
addresses of other elements can be calculated

You might also like