0% found this document useful (0 votes)
21 views7 pages

More Mcqs Data Structure and Algorithms (Set 8)

The document contains multiple-choice questions related to Data Structures and Algorithms (DSA), covering topics such as primitive data types, algorithm efficiency, data structures like stacks and queues, and linked lists. Each question is followed by four answer options, with the correct answers provided. The content is structured as a quiz format, suitable for testing knowledge in computer science concepts.

Uploaded by

mmaimsalim95
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views7 pages

More Mcqs Data Structure and Algorithms (Set 8)

The document contains multiple-choice questions related to Data Structures and Algorithms (DSA), covering topics such as primitive data types, algorithm efficiency, data structures like stacks and queues, and linked lists. Each question is followed by four answer options, with the correct answers provided. The content is structured as a quiz format, suitable for testing knowledge in computer science concepts.

Uploaded by

mmaimsalim95
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Data Structure and Algorithms (DSA)

8 of 14 sets

351. Which of the following 'C' type is not a primitive data structure?

A. int
B. float
C. char
D. none of these
Answer:D

352. The program fragment


int i = 263 ;
putchar (i) ; o m
prints
. c
te
A. 263 a
B. ascii equivalent of 263
q M
C. rings the bell
c
D. garbage
Answer:C
M
353. The variables which can be accessed by all modules in a program, are called

A. local variables
B. internal variables
C. external variable
D. global variables
Answer:D

354. The main measures of efficiency of an algorithm are


A. processor and memory
B. complexity and capacity
C. time and space
D. data and space
Answer:C

355. The worst case occures in linear search algorithms when


A. item is somewhere in the middle of the array
B. item is not there in the array at all
C. item is last element in the array
D. item is last element in the array or is not there at all.
Answer:D

356. the terms push and pop are related to


A. stack
B. queue
C. array
D. none of the above
Answer:A

357. What will be the output of the program? #include<stdio.h>


int main()
{
int X=40;
{
int X=20;
printf("%d ", X);
}
printf("%d\n", X);
return 0;
}
A. 40 40
B. 20 20
C. 20
D. error
Answer:D

358. What additional requirement is placed on an array, so that binary search may
be used to locate an entry?
A. the array elements must form a heap

View all MCQ's at McqMate.com


B. the array must have at least 2 entries.
C. the array must be sorted.
D. the array\s size must be a power of two.
Answer:C

359. One difference between a queue and a stack is:


A. queues require dynamic memory, but stacks do not.
B. stacks require dynamic memory, but queues do not
C. queues use two ends of the structure; stacks use only one.
D. stacks use two ends of the structure, queues use only one.
Answer:C

360. If the characters 'D', 'C', 'B', 'A' are placed in a queue (in that order), and
then removed one at a time, in what order will they be removed?
A. abcd
B. abdc
C. dcab
D. dcba
Answer:D

361. Which of the following formulas in big-O notation best represent the
expression n²+35n+6?
A. o(n³)
B. o(n²)
C. o(n)
D. o(42)
Answer:B

362. What term is used to describe an O(n) algorithm


A. constant
B. linear
C. logarithmic
D. quadratic
Answer:B

View all MCQ's at McqMate.com


363. The keyword used to transfer control from a function back to the calling
function is
A. switch
B. goto
C. go back
D. return
Answer:D

364. How many times the program will print "Amrutvahini" ? #include<stdio.h>
int main()
{
printf("Amrutvahini");
main();
return 0;
}
A. infinite times
B. 32767 times
C. 65535 times
D. till stack overflows
Answer:D

365. What will be the output of the program? #include<stdio.h>


int i;
int fun();

int main()
{
while(i)
{
fun();
main();
}
printf("Hello\n");
return 0;
}
int fun()
{
printf("Hi");
}
A. hello

View all MCQ's at McqMate.com


B. hi hello
C. no output
D. infinite loop
Answer:A

366. In a linked list, the pointer of the last node contains a special value, called the
______ pointer.
A. null
B. zero
C. link
D. next pointer
Answer:A

367. In a ________ linked list, the last node's link field points to the first node of
the list.
A. circularly
B. linearly
C. sequentially
D. indexed
Answer:A

368. The second part of the node, is called _______ field, and contains the address
of the next node in the list.
A. pointer
B. field
C. node
D. link
Answer:D

369. The link list also contains a list pointer variable called start or ________.
A. name
B. field
C. node
D. link
Answer:A

View all MCQ's at McqMate.com


370. A ________ linked list is a linked list structure in which each node has a
pointer to both its successor and predecessor.
A. circularly
B. doubly
C. linear
D. sequential
Answer:B

371. _______ list is a special list that is maintained, which consists of unused
memory cells.
A. linear
B. doubly linked
C. circularly linked
D. free storage
Answer:D

372. _______ is a technique using which a computer periodically collects all the
deleted space onto the free storage list.
A. garbage collection
B. garbage compaction
C. linked list
D. free storage
Answer:A

373. _______ attacks the problem of fragmentation by moving all the allocated
blocks to one end of memory, thus combining all the holes.
A. underflow
B. overflow
C. compaction
D. free storage
Answer:B

374. A ________ linked list is a linked list which always contains a special node,
called the header node.
A. circular
B. grounded

View all MCQ's at McqMate.com


C. header
D. doubly
Answer:C

375. A polynomial can be represented in a _______ by just storing the coefficient


and exponent of each term.
A. array
B. linked list
C. queue
D. stack
Answer:B

View all MCQ's at McqMate.com

You might also like