An open API service indexing awesome lists of open source software.

https://github.com/suniksha12/data_structure_mcq

Hackerank , MCQs solution with explanation today i went through 3 MCQS of data structure in hackerank problem.
https://github.com/suniksha12/data_structure_mcq

Last synced: 4 months ago
JSON representation

Hackerank , MCQs solution with explanation today i went through 3 MCQS of data structure in hackerank problem.

Awesome Lists containing this project

README

        

# Data Structures MCQs - Solved Today

Today, I worked on solving Data Structures MCQs. Below are the key questions I solved, along with the correct answers and links for more detailed explanations.

---

### **Q1: If we have a tree of 'n' nodes, how many edges will it have?**

1. 1
2. (n * (n - 1)) / 2
3. (n * (n - 1))
4. **n - 1** ✔️

For more detailed explanation, check out [this link](https://www.geeksforgeeks.org/g-fact-18/).

---

### **Q2: Which of the following data structures can handle updates and queries in log(n) time on an array?**

1. Linked list
2. Stack
3. **Segment Tree** ✔️
4. Queue

For more details, refer to [this link](https://www.geeksforgeeks.org/segment-tree/).

---

### **Q3: Of the following data structures, which has a Last In First Out (LIFO) ordering? In other words, the one that came in last will be the first to be popped.**

1. Queue
2. **Stack** ✔️
3. Vector
4. Array List

For more details, refer to [this link](https://www.geeksforgeeks.org/stack-data-structure/).

---

This file provides an overview of the questions I solved and the correct answers.