# Data structure/Data Structures and algorithms MCQ Questions Sample Test,Sample questions

## Question: ` In linear search algorithm the Worst case occurs when`

1. The item is somewhere in the middle of the array

2.The item is not in the array at all

3.The item is the last element in the array

4.The item is the last element in the array or is not there at all

2.Stacks

3.Queues

4.Deque

## Question: `A variable P is called pointer if`

1.P contains the address of an element in DATA.

2.P points to the address of first element in DATA

3.P can store only memory addresses

4.P contain the DATA and the address of DATA

## Question: `Arrays are best data structures`

1.for relatively permanent collections of data

2.for the size of the structure and the data in the structure are constantly changing

3.for both of above situation

4.for none of above situation

## Question: `Binary search algorithm can not be applied to`

2.sorted binary trees

3.sorted linear array

4.pointer array

## Question: `Each array declaration need not give implicitly or explicitly the information about`

1. the name of array

2.the data type of array

3. the first data from the set to be stored

4.the index set of the array

## Question: `Each data item in a record may be a group item composed of sub-items; those items which are indecomposable are called`

1.elementary items

2. atoms

3.scalars

4.all of above

1.Traversal

2.Search

3.Sort

4.None of above

## Question: `For an algorithm the complexity of the average case is`

1.Much more complicated to analyze than that of worst case

2.Much more simpler to analyze than that of worst case

3. Sometimes more complicated and some other times simpler than that of worst case

4.None or above

## Question: `he Average case occur in linear search algorithm`

1.When Item is somewhere in the middle of the array

2. When Item is not in the array at all

3.When Item is the last element in the array

4.When Item is the last element in the array or is not there at all

## Question: `If the values of a variable in one module is indirectly changed by another module this situation is called`

1. internal change

2. inter-module change

3. side effect

4.side-module update

## Question: `ï»¿When determining the efficiency of algorithm the space factor is measured by`

1.Counting the maximum memory needed by the algorithm

2.Counting the minimum memory needed by the algorithm

3.Counting the average memory needed by the algorithm

4.Counting the maximum disk space needed by the algorithm

## Question: `Linked lists are best suited`

1.for relatively permanent collections of data

2. for the size of the structure and the data in the structure are constantly changing

3.for both of above situation

4.for none of above situation

1.O(n)

2.O(log)

3.O(n2)

4.O(n log n)

1. O(n)

2.O(log n)

3.O(n2)

4.O(n log n)

1.O(n)

2.O(log n)

3.O(n2)

4. O(n log n)

1.O(n)

2.O(log n)

3.O(n2)

4. O(n log n)

## Question: `The difference between linear array and a record is`

1.An array is suitable for homogeneous data but the data items in a record may have different data type

2.In a record there may not be a natural ordering in opposed to linear array.

3. A record form a hierarchical structure but a linear array does not

4.All of above

## Question: `The elements of an array are stored successively in memory cells because`

1.by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated

2.the architecture of computer memory does not allow arrays to store other than serially

3.both of above

4.none of above

## Question: `The memory address of fifth element of an array can be calculated by the formula`

1.LOC(Array[5]=Base(Array)+w(5-lower bound) where w is the number of words per memory cell for the array

2.LOC(Array[5])=Base(Array[5])+(5-lower bound) where w is the number of words per memory cell for the array

3.LOC(Array[5])=Base(Array[4])+(5-Upper bound) where w is the number of words per memory cell for the array

4.None of above

1.Sorting

2.Merging

3.Inserting

4.Traversal

1.underflow

2.overflow

3.housefull

4.saturated

1.array

2.lists

3.stacks

4.all of above

1.tables arrays

2.matrix arrays

3.both of above

4.none of above

## Question: `Two main measures for the efficiency of an algorithm are`

1.Processor and memory

2.Complexity and capacity

3. Time and space

4. Data and space

## Question: `When determining the efficiency of algorithm the time factor is measured by `

1.Counting microseconds

2.Counting the number of key operations

3.Counting the number of statements

4.Counting the kilobytes of algorithm

1.FAEKCDBHG

2.FAEKCDHGB

3.EAFKHDCBG

4.FEAKDCHBG

1.underflow

2.overflow

3.housefull

4.saturated

1.Best case

2.Worst case

3.Average case

4.Null case

1. Arrays

2.Records

3.Pointers

4.None

1.Trees

2.Graphs

3.Arrays

4. None of above

1.Arrays

3.both of above

4.none of above

1. Arrays

2.Records

3.Pointers

4.None

1.linear arrays

3.both of above

4. none of above

## Question: `Which of the following is not a limitation of binary search algorithm?`

1.must use a sorted array

2.requirement of sorted array is expensive when a lot of insertion and deletions are needed

3.there must be a mechanism to access middle element directly

4.binary search algorithm is not efficient when the data elements are more than 1000.

## Question: `Which of the following is not the required condition for binary search algorithm?`

1.The list must be sorted

2. there should be the direct access to the middle element in any sublist

3. There must be mechanism to delete and/or insert elements in list

4.none of above

4. none of above

## Question: `Which of the following name does not relate to stacks?`

1. FIFO lists

2.LIFO list

3.Piles

4.Push-down lists

## Question: `Which of the following statement is false?`

1.Arrays are dense lists and static data structure

2.data elements in linked list need not be stored in adjacent space in memory

3.pointers store the next data element of a list

4. linked lists are collection of the nodes that contain information part and next poin

## More MCQS

##### Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!