# Data structure/Data Structure and Algorithms (DSA) set 4 Sample Test,Sample questions

1. 0 1 2 3

2. 0 1 2

3.1 2 3

4.compiler error

## Question: ` A declaration "short int" is used for variables`

1.which have a short duration in a program B. C.

2. which have short names

3.which may require less storage than normal integers

4.All of the three

1. three fields

2.two fields

3.four fields

4. one field

1.circularly

2.doubly

3.linear

4.sequential

1.no pointer

2.1 pointer

3.2 pointer

4.3 pointer

1.null B. C. D.

2.zero

4.next pointer

## Question: ` In C, if you pass an array as an argument to a function, what actually gets passed?`

1.value of elements in array

2. first element of the array

3. base address of the array

4.address of the last element of array

## Question: ` In linked list,a node contain`

1. node,adrees field and data field

2.node number and data field

3.next adress field and information field

4.None of the above

## Question: ` In linked list,the logical order of elements`

1. is same as their physical arrangement

2.is not necessarily equivalent to their physical arrangement

3.. is determined by their physical arrangement

4.none of the above

## Question: ` List pointer variable in linked list contains address of the`

1. following node in the first

2.current node in the first

3. first node in the first

4.none of the above

## Question: ` The declaration "unsigned u" indicates u is a/an`

1.unsigned character

2.unsigned integer

3.character

4.none of these

## Question: ` The members of the union are accessed by____`

1.dot operator

2.pointer -> operator

3.both a and b

4. none of these

## Question: ` To insert a node in a circular list at rear end it should be inserted at â€¦...of the queue`

1.front position

2.front-1position

3.rear position

4.rear-1 position

## Question: ``` What is the maximun number of dimensions an array in C may have? ```

1.two

2.eight

3.twenty

4.theoratically no limit. the only practical limits are memory size and compilers

## Question: ` What is true about linked kist?`

1.it is a linked structure,where each data gives the address of the next data

2. it is a dynamic data structure

3. it is a static data structure

4.both (a) and (b)

1.21

2.18

3.12

4.Compiler Error

## Question: ` Which of the following data structure is linear type ?`

1.strings

2.lists

3.queues

4.All of the above

1. a stack

2.a queue

3.a tree

4.both a and b

## Question: ```A node of linked list contains_______ ```

1. data field

2.a self referential pointer

3.both (a)and(b)

4.only b

1.array

3.queue

4.stack

1. A. static

2.auto

3.external

4.local

1.one way

2.linear array

3.two way

1.circular

2.grounded

4.doubly

## Question: `An external variable`

1. is globally accessible by all functions

2.has a declaration

3. will be initialized to 0 if not initialized

4.All of the three

## Question: `Are *ptr++ and ++*ptr are same?`

1. A. no they are not same B. C.

2.yes they are one and the same

3.yes they are one and the same

4. none of these

## Question: `Because of linear structure of linked list having linear ordering,there is similarity between linked list and array in`

1.insertion of a node

2.deletion of a node

3.traversal of elements of list

4.None of the above

1. abacus

2.charles babage

3.thomson

4.dennis ritchie

1.o(1)

2.o(log2n)

3. o(n)

4. o(n^2)

## Question: `Deletion of a node from an empty linked list will cause________`

1.underflow

2.overflow

3.run time error

4. all of the above

1. 7

2.8

3.15

4.16

## Question: ```How many times the program will print "Amrutvahini" ? #include<stdio.h> int main() { printf("Amrutvahini"); main(); return 0; }```

1. infinite times

2.32767 times

3. 65535 times

4.till stack overflows

1.abcd

2.abdc

3.dcab

4.dcba

1. circularly

2.linearly

3.sequentially

4.indexed

1.1

2.2

3.3

4.4

## Question: `Null pointer is used to tell`

1.end of linked list

2. empty pointer field of a structure

3.the linked list is empty

4. all of the above

## Question: `One difference between a queue and a stack is:`

1.queues require dynamic memory, but stacks do not.

2.stacks require dynamic memory, but queues do not

3. queues use two ends of the structure; stacks use only one.

4.stacks use two ends of the structure, queues use only one.

1.fifo

2.lifo

3.lilo

4.liso

## Question: `Searching of linked list requires linked list to be created`

1.in stored order only

2.in any order

3.without underflow condition

4.None of the above

1. o(n)

2.o(log n)

3.o(n2)

4.o(n log n)

## Question: `The data type created by the data abstraction process is called`

1. class

2.structure

3.abstract data type

4. user defined data type

1. switch

2.goto

3.go back

4.return

1.name

2. field

3.node

## Question: `The main measures of efficiency of an algorithm are`

1.processor and memory

2.complexity and capacity

3. time and space

4.data and space

1.<<

2. >>

3.&

4./

## Question: ```The program fragment int i = 263 ; putchar (i) ; prints```

1. 263

2.ascii equivalent of 263

3.rings the bell

4.garbage

1.0001 1111

2.1111 0001

3.0000 1000

4.None of These

1.0101 1100

2. 0110 1000

3.0001 1110

4.None of These

1.0101 1001

2.1010 0100

3.0000 0010

4.none of these

1. pointer

2.field

3.node

## Question: `the terms push and pop are related to`

1. stack

2.queue

3.array

4.None of the above

## Question: `The variables which can be accessed by all modules in a program, are called`

1.local variables

2.internal variables

3.external variable

4.global variables

## Question: `The worst case occures in linear search algorithms when`

1.item is somewhere in the middle of the array

2.item is not there in the array at all

3.item is last element in the array

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

1.two bytes

2.four bytes

3.one bytes

4.eight bytes

1.two bytes

2.four bytes

3.one bytes

4.eight bytes

## Question: `What additional requirement is placed on an array, so that binary search may be used to locate an entry?`

1.the array elements must form a heap

2. the array must have at least 2 entries.

3. the array must be sorted.

4.the arrays size must be a power of two.

## Question: `What is the similarity between structure,union and enum?`

1. all of them let you define new values

2.all of them let you define new pointers

3. all of them let you define new structure

4.all of them let you define new data types

1.constant

2.linear

3.logarithmic

1.5

2.6

3.7

4.0

1. 135

2. +inf

3.-121

4. -8

1.12

2.8

3.4

4.1

## Question: ```What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int a=2; if(a==2){ a=~a+2<<1; printf("%d",a); } else{ break; } return 0; }```

1. it will print nothing

2.-3

3.-2

4. compiler error

1.equal

2. less than

3. greater than

4.compiler error

1.-60

2.-30

3.60

4.garbage value

## Question: `What will be the output of the following code? Void main(){int a=10;int *b=&a;int **c=&b;printf("%d %d %d",a,*b,**c);}`

1.0 10 garbage

2.10 garbage garbage

3.10 10 10

4.syntax error

1.hello

2.hi hello

3.no output

4. infinite loop

1.40 40

2.20 20

3.20

4.error

## Question: `Which data structure allows deleting data elements from front and inserting at rear?`

1. stack

2.queue

3.dequeue

4.binary search tree

## Question: `Which nodes contains a null pointer in a linked list?`

1.first node

2.middle node

3.last node

4. both (a) and (b)

1.int

2.float

3.char

4.none of these

1.trees

2.graphs

3.arrays

4.none of above

1.o(nÂ³)

2.o(nÂ²)

3.o(n)

4.o(42)

## Question: `Which of the following is a collection of different data type elements?`

1.array

2.structure

3.string

4.all of the above

## Question: `Which of the following statement is true about char ****a ?`

1. a is pointer to a pointer to a pointer to char

2.a is pointer to a pointer to a pointer to char

3.a is a pointer to a char pointer

4.a is a pointer to a pointer to a char

1.underflow

2.overflow

3.compaction

4.free storage

## Question: `____ header list combines the advantages of a two-way list and a circular header list.`

1. one way

2.two way circular

3.two way

## Question: `_____ attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes.`

1.garbage collection

2. garbage compaction

3.buddy system

4.queue

1.linear

4.free storage

## Question: `______ is a technique using which a computer periodically collects all the deleted space onto the free storage list.`

1.garbage collection

2.garbage compaction

4.free storage

1. free storage

2.underflow

3.overflow

4.compaction

1.stack

2.queue

3.buddy system

4.recursion

## 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!