- 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.

Stack uses push() to insert an item in stack, and pop() to remove the top item from stack.

Q 3 - Minimum number of moves required to solve a *Tower of Hanoi* puzzle is

Minimum number of moves required to solve a Tower of Hanoi puzzle is 2^{n} - 1. Where n is the number of disks. If the number of disks is 3, then minimum number of moves required are 2^{3} - 1 = 7

Q 4 - Binary search tree has best case run-time complexity of Ο(log n). What could the worst case?

In case where binary search tree is left or right intended, the worst case can be Ο(n)

Q 5 - After each iteration in bubble sort

A - at least one element is at its sorted position.

In one iteration of Bubble sort, the maximum of the set in hand is moved at the end of the unsorted list. Hence one less comparison.

Q 6 - In context with time-complexity, find the odd out −

A - Deletion from Linked List.

Binary heap heapify operation has time-complexity of Ο(n), while other operations have time-complexity of Ο(1) only.

Q 7 - Index of arrays in C programming langauge starts from

Arrays, in C, starts from 0 which is mapped to its base address.

Q 8 - All possible spanning trees of graph G

A - have same number of edges and vertices.

B - have same number of edges and but not vertices.

All possible spanning trees of graph G, have same number of edges and vertices.

Q 9 - Access time of a binary search tree may go worse in terms of time complexity upto

At maximum, BST may need to search all n values in the tree in order to access an element, hence, Ο(n).

Q 10 - If the data collection is in sorted form and equally distributed then the run time complexity of interpolation search is −

Runtime complexity of interpolation search algorithm is Ο(log (log n)) as compared to Ο(log n) of BST in favourable situations.

data_structures_algorithms_questions_answers.htm

Advertisements