- Data Structures & Algorithms
- DSA - Home
- DSA - Overview
- DSA - Environment Setup

- Algorithm
- DSA - Algorithms Basics
- DSA - Asymptotic Analysis
- DSA - Greedy Algorithms
- DSA - Divide and Conquer
- DSA - Dynamic Programming

- Data Structures
- DSA - Data Structure Basics
- DSA - Array Data Structure

- Stack & Queue
- DSA - Stack
- DSA - Expression Parsing
- DSA - Queue

- Searching Techniques
- DSA - Linear Search
- DSA - Binary Search
- DSA - Interpolation Search
- DSA - Hash Table

- Sorting Techniques
- DSA - Sorting Algorithms
- DSA - Bubble Sort
- DSA - Insertion Sort
- DSA - Selection Sort
- DSA - Merge Sort
- DSA - Shell Sort
- DSA - Quick Sort

- Graph Data Structure
- DSA - Graph Data Structure
- DSA - Depth First Traversal
- DSA - Breadth First Traversal

- Tree Data Structure
- DSA - Tree Data Structure
- DSA - Tree Traversal
- DSA - Binary Search Tree
- DSA - AVL Tree
- DSA - Spanning Tree
- DSA - Heap

- DSA Useful Resources
- DSA - Questions and Answers
- DSA - Quick Guide
- DSA - Useful Resources
- DSA - Discussion

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Following quiz provides Multiple Choice Questions (MCQs) related to **Data Structures Algorithms**. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using **Show Answer** button. You can use **Next Quiz** button to check new set of questions in the quiz.

Q 1 - In a min-heap:

A - parent nodes have values greater than or equal to their childs

B - parent nodes have values less than or equal to their childs

In a min heap, parents always have lesser or equal values than that of their childs.

Q 2 - What data structure is used for depth first traversal of a graph?

Stack is used for depth first traversal whereas queue is used for breadth first traversal

Q 3 - The following formular is of

left_subtree (keys) ≤ node (key) ≤ right_subtree (keys)

A binary search tree (BST) is a tree in which all nodes follows the below mentioned properties −

The left sub-tree of a node has key less than or equal to its parent node's key.

The right sub-tree of a node has key greater than or equal to its parent node's key.

Q 4 - Which of the following searching techniques do not require the data to be in sorted form

Both binary and interpolation search requires data set to be in sorted form. Linear search can work even if the data is not sorted.

Q 5 - Apriory algorithm analysis does not include −

Algorithms are independent of programming languages, hence, program complexity is not a part of algorithm analysis.

Q 6 - Which of the below mentioned sorting algorithms are not stable?

Except selection sort, all other soring algorithms are stable.

Q 7 - Which of the following is not possible with an array in C programming langauge −

Array in C are static and cannot be shrinked or expanded in run-time.

Q 8 - Program with highest run-time complexity is

Tower of hanoi has the highest run time complexity

Q 9 - If we choose Prim's Algorithm for uniquely weighted spanning tree instead of Kruskal's Algorithm, then

A - we'll get a different spanning tree.

B - we'll get the same spanning tree.

Regardless of which algorithm is used, in a graph with unique weight, resulting spanning tree will be same.

Q 10 - Interpolation search is an improved variant of binary search. It is necessary for this search algorithm to work that −

A - data collection should be in sorted form and equally distributed.

B - data collection should be in sorted form and but not equally distributed.

C - data collection should be equally distributed but not sorted.

For this algorithm to work properly the data collection should be in sorted form and equally distributed.

data_structures_algorithms_questions_answers.htm

Advertisements