Data Structure and Algorithms (DSA) MCQs with answers Page - 16

Here, you will find a collection of MCQ questions on Data Structure and Algorithms (DSA). Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

Q. Finite sequence S of Zero or more chatacters is called_____

  • (A) array
  • (B) list
  • (C) string
  • (D) block

A

Admin • 833.24K Points
Coach

Q. String with zero characters is called____string

  • (A) null
  • (B) binary
  • (C) totalled
  • (D) list

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

Q. _____operation of word processing invovles replacing one string in the text by another.

  • (A) insertion
  • (B) deletion is easier
  • (C) searching
  • (D) replacement

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

Q. If string1=john,and string2=Rivers are merged,the process is called

  • (A) insertion
  • (B) deletion
  • (C) concatenation
  • (D) replacement

A

Admin • 833.24K Points
Coach

Q. ____is a variable whose length may vary during the execution of a program.

  • (A) dynamic
  • (B) static
  • (C) semistatistic
  • (D) global

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

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;

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ