0% found this document useful (0 votes)
3 views6 pages

More Mcqs Data Structure and Algorithms [Set 4]

The document contains a series of multiple-choice questions related to Data Structures and Algorithms (DSA), covering topics such as character functions, pointers, data structures, sorting algorithms, and their complexities. Each question is followed by four answer options, with the correct answers indicated. The content serves as a quiz or study guide for individuals learning about DSA 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)
3 views6 pages

More Mcqs Data Structure and Algorithms [Set 4]

The document contains a series of multiple-choice questions related to Data Structures and Algorithms (DSA), covering topics such as character functions, pointers, data structures, sorting algorithms, and their complexities. Each question is followed by four answer options, with the correct answers indicated. The content serves as a quiz or study guide for individuals learning about DSA 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
You are on page 1/ 6

Data Structure and Algorithms (DSA)

4 of 14 sets

151. The function islower(char)checks whether a character is in lower case or


not.Therefore it should return______
A. 0 or 1
B. -1, 0 or 1
C. a character
D. nothing
Answer:A

152. A variable P is called pointer if__


A. p contains the address of an element in data
o m
B. p points to the address of first element in data
. c
C. p can store only memory address
te
D. p contain the data and the address of data
a
Answer:A
q M
c
M
153. Which of the following data structure can't store the non-homogeneous data
element?
A. arrays
B. records
C. pointers
D. none
Answer:A

154. The difference between linear array and a record is_____


A. an array is suitable for homogeneous data but the data items in a record may have different
data type
B. in a record,theremay not be a natural ordering in opposed ti linear array
C. a record form a hierarchical structure but a linear array does not
D. all of above
Answer:D
155. If s1 is "ABC" and s2 is "DEF" then strcat(s1,s2)will give the following result.
A. s1="abcdef" and s2="def"
B. s1="abcdef" and s2="def"
C. s1="abc" and s2="abcdef"
D. s1="abc" and s2="abcdef"
Answer:A

156. Give output of the following programint


main(){inta[]={2,3,4,5,6};printf("%d",2[a]);}
A. compilation error
B. run time error
C. 4
D. 2
Answer:C

157. Where do we use the operator --> ?


A. to access a member of structure
B. to access member of union
C. to access an array
D. both(a) and(b).
Answer:D

158. The function strcmp(s1,s2)will return -1 if____


A. s1>s2
B. s1=s2
C. s1<s2
D. function does not return -1.
Answer:C

159. Which of the following data structure store the homogeneous data elements?
A. arrays
B. records
C. pointers
D. none
Answer:A

View all MCQ's at McqMate.com


160. The number of comparisons required to sort 5 numbers in ascending order
using bubble sort are
A. 7
B. 6
C. 10
D. 5
Answer:C

161. A sorting algorithm is stable if


A. its time complexity is constant irrespective of the nature of input
B. preserves the original order of records with equal keys
C. its space complexity is constant irrespective of the nature of input
D. it sorts any volume of data in a constant time
Answer:B

162. The average case complexity of Insertion Sort is


A. o(2n)
B. o(n3)
C. o(n2)
D. o(2n)
Answer:C

163. A sorted file contains 16 items. Using binary search, the maximum number of
comparisons to search for an item in this file is
A. 15
B. 8
C. 1
D. 4
Answer:D

164. A sort which compares adjacent elements in a list and switches where
necessary is
A. insertion sort
B. heap sort
C. quick sort
D. bubble sort

View all MCQ's at McqMate.com


Answer:D

165. A sort which iteratively passes through a list to exchange the first element
with any element less than it and then repeats with a new first element is called
A. insertion sort
B. selection sort
C. heap sort
D. quick sort
Answer:B

166. The number of swappings needed to sort the numbers 8, 22, 7, 9, 31, 19, 5, 13
in ascending order, using bubble sort is
A. 11
B. 12
C. 13
D. 14
Answer:D

167. A sorting technique that guarantees that records with the same primary key
occurs in the same order in the sorted list as in the original unsorted list is said to
be
A. stable
B. consistent
C. external
D. linear
Answer:A

168. You want to check whether a given set of items is sorted. Which of the
following sorting methods will be most efficient if it is already in sorted order?
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:C

169. Which of the following sorting methods will be the best if number of
swappings done, is the only measure of efficienty?

View all MCQ's at McqMate.com


A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:B

170. You are asked to sort 15 randomly generated numbers. You should prefer
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:A

171. What is the number of swaps required to sort n elements using selection sort,
in the worst case?
A. ?(n)
B. ?(n log n)
C. ?(n2)
D. ?(n2 log n)
Answer:A

172. The number of interchanges required to sort 5, 1, 6, 2 4 in ascending order


using Bubble Sort is
A. 6
B. 5
C. 7
D. 8
Answer:B

173. The smallest element of an array’s index is called its


A. lower bound
B. upper bound
C. range
D. extraction
Answer:A

View all MCQ's at McqMate.com


174. Which of the following sorting methods would be most suitable for sorting a
list which is almost sorted
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:A

175. The complexity of Bubble sort algorithm is


A. o(n)
B. o(log n)
C. o(n2)
D. o(n log n)
Answer:C

View all MCQ's at McqMate.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy