Top 350+ Solved Data Structure and Algorithms (DSA) MCQ Questions Answer
Q. Linked lists are not suitable to for the implementation of?
a. insertion sort
b. radix sort
c. polynomial manipulation
d. binary search
Q. In worst case, the number of comparison need to search a singly linked list of length n for a given element is
a. log n
b. n/2
c. log2n-1
d. n
Q. consider the function f defined here:struct item{int data;struct item * next;};int f (struct item *p){return((p==NULL) ||((p->next==NULL)||(p->data<=p->next->data) && (p->next)));}For a given linked list p, the function f returns 1 if and only if
a. the list is empty or has exactly one element
b. the element in the list are sorted in non-decreasing order of data value
c. the element in the list are sorted in non-increasing order of data value
d. not all element in the list have the same data value
Q. Groups of consecutive element in a string.Such as words,phrase and sentences are called___
a. main string
b. substring
c. index
d. block
Q. _____operation of word processing invovles replacing one string in the text by another.
a. insertion
b. deletion is easier
c. searching
d. replacement
Q. _____is the problem of deciding whether or not a given string problem p appears in a text T.
a. pattern matching
b. searching
c. sorting
d. deletion
Q. If string1=john,and string2=Rivers are merged,the process is called
a. insertion
b. deletion
c. concatenation
d. replacement
Q. ____is a variable whose length may vary during the execution of a program.
a. dynamic
b. static
c. semistatistic
d. global
Q. NurseryLand.Nursery.Students = 10;
a. the structure students is nested within the structure nursery
b. the structure nurseryland is nested within the structure nursery.
c. the structure nursery is nested within the structure nurseryland.
d. the structure nursery is nested within the structure students
Q. If a function is declared as void fn(int *p), then which of the following statements is valid to call function fn?
a. fn(x) where x is defined as int x;
b. fn(x) where x is defined as int *x;
c. fn(&x) where x is defined as int *x;
d. fn(*x) where x is defined as int *x;
Q. To declare an array S that holds a 5-character string, you would write
a. char s[5]
b. char s[6]
c. string s[5]
d. stringchar s[5]