Data Structures Algorithms-II MCQs

Page No. 51

What is the range of rand()?


a0 to RAND_MAX


b 0 to infinity


c0 to 2147483647


d0 to 32767


View Answer 0 to RAND_MAX

What is the purpose of using function srand()?


ato set the seed of rand() function


bto generate random numbers


cto enable rand() function


dto improve efficiency of rand()



What should be the return type of rand() function?


aint


bfloat


clong


ddouble


View Answer int

What is pseudo random number generator?


aan algorithm that generates random numbers with help of mathematical formula


ban algorithm that generates random numbers according to user activity


can algorithm that generates random numbers according to time


dan algorithm that generates random numbers with help of user input



. What will be the output of the code that generates permutations and also has the ability to handle duplicates, for the input str[]=”AA”?


aAA


bAA,AA


c A,A


d A


View Answer AA

What is the time complexity of Heap’s algorithm?


aO(n log n)


b O(n2)


cO(n*n!)


dO(n!)


View Answer O(n!)

Heap’s algorithm requires an auxiliary array to create permutations.


a true


bfalse


cA & B


dNone of these


View Answer false

What will be the lexicographical order of permutations formed from the array arr={1,2,3}?


a {{2,1,3},{3,2,1},{3,1,2},{2,3,1},{1,2,3},{1,3,2}}


b{{1,2,3},{1,3,2},{2,3,1},{2,1,3},{3,2,1},{3,1,2}}


c{{1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,1,2},{3,2,1}}


d{{2,1,3},{3,1,2},{3,2,1},{2,3,1},{1,2,3},{1,3,2}}



How many permutations will be formed from the array arr={1,2,3}?


a2


b4


c6


d8


View Answer 6

The dictionary ordering of elements is known as?


aLexicographical order


bColexicographical order


cWell order


dSorting


View Answer Lexicographical order

Goto Page No.

Page 51 of 149

Alphabetical MCQs Categories

Here below You find all kind of categories of MCQs in alphabetical order.


"Comprehensive Collection of MCQs: Alphabetically Organized by Subject"

"Discover an extensive collection of multiple-choice questions (MCQs) neatly categorized by subject from A to Z. This resource is designed for anyone eager to explore various topics in a straightforward and organized manner. Whether you're a student preparing for exams, an educator seeking supplementary materials, or simply curious about different subjects, this compilation offers a convenient way to learn and assess your knowledge. With questions arranged alphabetically, navigation is effortless, allowing you to delve into subjects of interest at your own pace. Engage, learn, and expand your understanding with this accessible and comprehensive repository of MCQs!"


BolPakistan

bolpakistan.com.pk includes Job Mcqs and Pak Mcqs is the Top Largest Mcqs Forum in World, in which you can read Mcqs of All Subjects, PPSC test preparation, FPSC, NTS and PPSC PAST PAPERS, PPSC PAST MCQS. A Collection of Repeated MCQs for JOBs seekers.

Copyright © 2024, Designed & Developed by BolPakistan