Data Structures and Algorithms — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye

📚 16 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
16 questions
1
EN + हिं Medium
GB Left child of node i in array representation?
IN सरणी प्रतिनिधित्व में नोड I का बायां बच्चा?
A
i-1 मैं -1
B
i+1 मैं+1
C
2i 2i
D
i/2 मैं/2
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Left child of node i = 2i.
व्याख्या (हिन्दी) नोड i = 2i का बायाँ बच्चा।
2
EN + हिं Medium
GB Right child of node i in array representation?
IN सरणी प्रतिनिधित्व में नोड i का सही बच्चा?
A
2i 2i
B
2i+1 2i+1
C
2i-1 2i-1
D
i+1 मैं+1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Right child of node i = 2i+1.
व्याख्या (हिन्दी) नोड i का दायां बच्चा = 2i+1.
3
EN + हिं Medium
GB Parent of node i in array representation?
IN सरणी प्रतिनिधित्व में नोड I का जनक?
A
2i 2i
B
i+1 मैं+1
C
floor(i/2) मंजिल(i/2)
D
i-1 मैं -1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Parent of node i = floor(i/2).
व्याख्या (हिन्दी) नोड का जनक i = मंजिल(i/2)।
4
EN + हिं Medium
GB 2D array graph representation?
IN 2डी सरणी ग्राफ प्रतिनिधित्व?
A
Adjacency list निकटवर्ती सूची
B
Adjacency matrix सहखंडज मैट्रिक्स
C
Edge list किनारे की सूची
D
Incidence matrix घटना मैट्रिक्स
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Adjacency matrix: V×V 2D array; matrix[i][j]=1 if edge exists.
व्याख्या (हिन्दी) निकटवर्ती मैट्रिक्स: V×V 2D सरणी; मैट्रिक्स[i][j]=1 यदि किनारा मौजूद है।
5
EN + हिं Medium
GB Array is?
IN ऐरे है?
A
Collection of nodes with pointers पॉइंटर्स के साथ नोड्स का संग्रह
B
Elements of same type at contiguous memory locations सन्निहित स्मृति स्थानों पर एक ही प्रकार के तत्व
C
Key-value pairs कुंजी-मूल्य जोड़े
D
Hierarchical structure पदानुक्रमित संरचना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Array: same data type elements at contiguous memory locations.
व्याख्या (हिन्दी) सारणी: सन्निहित स्मृति स्थानों पर समान डेटा प्रकार के तत्व।
6
EN + हिं Medium
GB Insertion at beginning of array of n elements?
IN एन तत्वों की सरणी की शुरुआत में सम्मिलन?
A
O(1) हे(1)
B
O(log n) ओ(लॉग एन)
C
O(n) पर)
D
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Insert at beginning requires shifting all n elements — O(n).
व्याख्या (हिन्दी) शुरुआत में सम्मिलित करने के लिए सभी n तत्वों - O(n) को स्थानांतरित करने की आवश्यकता होती है।
7
EN + हिं Medium
GB Suffix array is used for:
IN प्रत्यय सरणी का उपयोग इसके लिए किया जाता है:
A
Sorting suffixes प्रत्ययों को क्रमबद्ध करना
B
Efficient string operations (search, LCP) by storing sorted suffixes क्रमबद्ध प्रत्ययों को संग्रहीत करके कुशल स्ट्रिंग संचालन (खोज, एलसीपी)।
C
Prefix operations उपसर्ग संचालन
D
Hash table हैश तालिका
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Suffix array enables O(m log n) pattern matching.
व्याख्या (हिन्दी) प्रत्यय सरणी O(m log n) पैटर्न मिलान को सक्षम बनाती है।
8
EN + हिं Medium
GB The maximum subarray sum problem is solved by:
IN अधिकतम उपसरणी योग समस्या का समाधान निम्न द्वारा किया जाता है:
A
Brute force O(n^3) क्रूर बल O(n^3)
B
Kadane algorithm in O(n) O(n) में कडेन एल्गोरिथम
C
Divide and conquer only केवल बांटो और राज करो
D
DP always O(n^2) DP हमेशा O(n^2)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Kadane: O(n) max subarray sum.
व्याख्या (हिन्दी) कदाने: O(n) अधिकतम उपसरणी योग।
9
EN + हिं Medium
GB Dutch National Flag problem sorts array of 0s, 1s, 2s in:
IN डच राष्ट्रीय ध्वज समस्या 0s, 1s, 2s की सारणी को क्रमबद्ध करती है:
A
O(n log n) ओ(एन लॉग एन)
B
O(n) using three-way partitioning O(n) तीन-तरफ़ा विभाजन का उपयोग करते हुए
C
O(n^2) ओ(एन^2)
D
O(1) हे(1)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Three pointers: O(n) single pass.
व्याख्या (हिन्दी) तीन संकेतक: ओ(एन) सिंगल पास।
10
EN + हिं Medium
GB Binary search on sorted array {1,3,5,7,9,11,13}: how many comparisons to find 7?
IN क्रमबद्ध सरणी पर बाइनरी खोज {1,3,5,7,9,11,13}: 7 खोजने के लिए कितनी तुलनाएँ?
A
1 1
B
2 2
C
3 3
D
4 4
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) mid=7 at index 3; 3 comparisons: check mid=7 (found); at most 3 needed.
व्याख्या (हिन्दी) सूचकांक 3 पर मध्य=7; 3 तुलनाएँ: जाँच मध्य=7 (पाया गया); अधिकतम 3 की आवश्यकता है।
11
EN + हिं Medium
GB Ternary search divides array into:
IN टर्नरी खोज सरणी को इसमें विभाजित करती है:
A
Two halves दो हिस्से
B
Three parts (finds max/min of unimodal function) तीन भाग (यूनिमॉडल फ़ंक्शन का अधिकतम/मिनट ज्ञात करता है)
C
Three equal parts for searching खोज के लिए तीन बराबर भाग
D
Random parts यादृच्छिक भाग
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Ternary search: for unimodal functions, O(log3(n)).
व्याख्या (हिन्दी) टर्नरी खोज: यूनिमॉडल फ़ंक्शंस के लिए, O(log3(n))।
12
EN + हिं Medium
GB Suffix array is used for:
IN प्रत्यय सरणी का उपयोग इसके लिए किया जाता है:
A
Sorting suffixes प्रत्ययों को क्रमबद्ध करना
B
Efficient string operations (search, LCP) by storing sorted suffixes क्रमबद्ध प्रत्ययों को संग्रहीत करके कुशल स्ट्रिंग संचालन (खोज, एलसीपी)।
C
Prefix operations उपसर्ग संचालन
D
Hash table हैश तालिका
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Suffix array enables O(m log n) pattern matching.
व्याख्या (हिन्दी) प्रत्यय सरणी O(m log n) पैटर्न मिलान को सक्षम बनाती है।
13
EN + हिं Medium
GB The maximum subarray sum problem is solved by:
IN अधिकतम उपसरणी योग समस्या का समाधान निम्न द्वारा किया जाता है:
A
Brute force O(n^3) क्रूर बल O(n^3)
B
Kadane algorithm in O(n) O(n) में कडेन एल्गोरिथम
C
Divide and conquer only केवल बांटो और राज करो
D
DP always O(n^2) DP हमेशा O(n^2)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Kadane: O(n) max subarray sum.
व्याख्या (हिन्दी) कदाने: O(n) अधिकतम उपसरणी योग।
14
EN + हिं Medium
GB Dutch National Flag problem sorts array of 0s, 1s, 2s in:
IN डच राष्ट्रीय ध्वज समस्या 0s, 1s, 2s की सारणी को क्रमबद्ध करती है:
A
O(n log n) ओ(एन लॉग एन)
B
O(n) using three-way partitioning O(n) तीन-तरफ़ा विभाजन का उपयोग करते हुए
C
O(n^2) ओ(एन^2)
D
O(1) हे(1)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Three pointers: O(n) single pass.
व्याख्या (हिन्दी) तीन संकेतक: ओ(एन) सिंगल पास।
15
EN + हिं Medium
GB Binary search on sorted array {1,3,5,7,9,11,13}: how many comparisons to find 7?
IN क्रमबद्ध सरणी पर बाइनरी खोज {1,3,5,7,9,11,13}: 7 खोजने के लिए कितनी तुलनाएँ?
A
1 1
B
2 2
C
3 3
D
4 4
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) mid=7 at index 3; 3 comparisons: check mid=7 (found); at most 3 needed.
व्याख्या (हिन्दी) सूचकांक 3 पर मध्य=7; 3 तुलनाएँ: जाँच मध्य=7 (पाया गया); अधिकतम 3 की आवश्यकता है।
1–15 of 16