Data Structures and Algorithms — MCQ Practice

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

📚 1018 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
1018 questions

Question 826

EN + हिं Medium
GB Counting sort is not a comparison sort and runs in:
IN गिनती सॉर्ट तुलनात्मक सॉर्ट नहीं है और इसमें चलता है:
O(n log n) ओ(एन लॉग एन)
O(n + k) where k is range of values O(n + k) जहां k मानों की सीमा है
O(n^2) ओ(एन^2)
O(k) ठीक है)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Counting sort: O(n+k) time and space.
व्याख्या (हिन्दी) गिनती क्रम: O(n+k) समय और स्थान।
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 827

EN + हिं Hard
GB Radix sort time complexity for n numbers with d digits:
IN डी अंकों के साथ एन संख्याओं के लिए रेडिक्स सॉर्ट समय जटिलता:
O(d*n) ओ(डी*एन)
O(n log n) ओ(एन लॉग एन)
O(n^2) ओ(एन^2)
O(d*n) = O(n) if d is constant O(d*n) = O(n) यदि d स्थिर है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Radix: O(d*(n+k)) where k is digit range.
व्याख्या (हिन्दी) मूलांक: O(d*(n+k)) जहां k अंक सीमा है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है — difficulty level "Hard", और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 828

EN + हिं Medium
GB Bucket sort is efficient when input is:
IN इनपुट होने पर बकेट सॉर्ट कुशल होता है:
Any data कोई भी डेटा
Uniformly distributed in a known range ज्ञात सीमा में समान रूप से वितरित
Sorted already पहले से ही क्रमबद्ध
Integer only केवल पूर्णांक
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Bucket sort: O(n) average for uniform distribution.
व्याख्या (हिन्दी) बकेट सॉर्ट: समान वितरण के लिए O(n) औसत।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 829

EN + हिं Medium
GB Shell sort is a generalization of:
IN शेल सॉर्ट इसका सामान्यीकरण है:
Merge sort मर्ज सॉर्ट
Insertion sort (with gap sequences) सम्मिलन क्रम (अंतराल अनुक्रम के साथ)
Quick sort त्वरित छँटाई
Heap sort ढेर बनाएं और छांटें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Shell sort: insertion sort with diminishing gaps.
व्याख्या (हिन्दी) शैल प्रकार: घटते अंतराल के साथ सम्मिलन प्रकार।
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 830

EN + हिं Medium
GB Tim sort (used in Python and Java) combines:
IN टिम सॉर्ट (पायथन और जावा में प्रयुक्त) जोड़ता है:
Only merge sort केवल मर्ज सॉर्ट करें
Insertion sort for small runs + merge sort छोटे रन के लिए इंसर्शन सॉर्ट + मर्ज सॉर्ट
Quick sort + heap sort त्वरित सॉर्ट + ढेर सॉर्ट
All four sorts सभी चार प्रकार
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) TimSort: insertion sort for small arrays + merge for merging.
व्याख्या (हिन्दी) टिमसॉर्ट: छोटे सरणियों के लिए सम्मिलन सॉर्ट + विलय के लिए मर्ज।
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 831

EN + हिं
GB The output of: int arr[]={5,2,8,1,9}; int n=5; for(int i=0;iarr[j+1]) swap(arr[j],arr[j+1]); cout<
IN इसका आउटपुट: int arr[]={5,2,8,1,9}; int n=5; for(int i=0;i
1 1
5 5
2 2
9 9
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Bubble sort: after sorting arr[0]=1.
व्याख्या (हिन्दी) बबल सॉर्ट: arr[0]=1 सॉर्ट करने के बाद।
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 832

EN + हिं
GB The output of: int arr[]={64,34,25,12,22,11,90}; // selection sort: for(int i=0;i<6;i++){int m=i; for(int j=i+1;j<7;j++) if(arr[j]
IN इसका आउटपुट: int arr[]={64,34,25,12,22,11,90}; // चयन प्रकार: for(int i=0;i
11 11
64 64
12 12
25 25
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Selection sort puts smallest first: 11.
व्याख्या (हिन्दी) चयन प्रकार सबसे छोटे को पहले रखता है: 11.
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 833

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 खोजने के लिए कितनी तुलनाएँ?
1 1
2 2
3 3
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 की आवश्यकता है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है — difficulty level "Medium", और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 834

EN + हिं Easy
GB What is the maximum comparisons in binary search for n=1024 elements?
IN n=1024 तत्वों के लिए बाइनरी खोज में अधिकतम तुलना क्या है?
10 10
11 11
512 512
1024 1024
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) log2(1024)+1=10+1=11 worst case comparisons.
व्याख्या (हिन्दी) log2(1024)+1=10+1=11 सबसे खराब स्थिति तुलना।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Easy"। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 835

EN + हिं Medium
GB Interpolation search works best when:
IN इंटरपोलेशन खोज सबसे अच्छा तब काम करती है जब:
Any data कोई भी डेटा
Data is uniformly distributed (better than binary search) डेटा समान रूप से वितरित किया जाता है (बाइनरी खोज से बेहतर)
Sorted data only केवल क्रमबद्ध डेटा
Random data यादृच्छिक डेटा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Interpolation: O(log log n) for uniform distribution.
व्याख्या (हिन्दी) इंटरपोलेशन: समान वितरण के लिए ओ (लॉग लॉग एन)।
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 836

EN + हिं Medium
GB Exponential search is useful when:
IN घातीय खोज तब उपयोगी होती है जब:
Any array कोई भी सरणी
Array is sorted and size is unknown (infinite/very large) सरणी क्रमबद्ध है और आकार अज्ञात है (अनंत/बहुत बड़ा)
Small arrays छोटी सारणियाँ
Linked lists लिंक की गई सूचियाँ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Exponential finds range then binary searches it.
व्याख्या (हिन्दी) एक्सपोनेंशियल रेंज ढूंढता है फिर बाइनरी उसे खोजता है।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 837

EN + हिं Medium
GB Ternary search divides array into:
IN टर्नरी खोज सरणी को इसमें विभाजित करती है:
Two halves दो हिस्से
Three parts (finds max/min of unimodal function) तीन भाग (यूनिमॉडल फ़ंक्शन का अधिकतम/मिनट ज्ञात करता है)
Three equal parts for searching खोज के लिए तीन बराबर भाग
Random parts यादृच्छिक भाग
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Ternary search: for unimodal functions, O(log3(n)).
व्याख्या (हिन्दी) टर्नरी खोज: यूनिमॉडल फ़ंक्शंस के लिए, O(log3(n))।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 838

EN + हिं Medium
GB Jump search works by:
IN जंप सर्च इनके द्वारा कार्य करता है:
Random jumps बेतरतीब छलांग
Jumping ahead by sqrt(n) steps then linear search back sqrt(n) चरणों से आगे बढ़ते हुए फिर रैखिक खोज
Binary then linear बाइनरी फिर रैखिक
Only forward केवल आगे
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Jump: O(sqrt(n)) time for sorted arrays.
व्याख्या (हिन्दी) कूदें: क्रमबद्ध सरणियों के लिए O(sqrt(n)) समय।
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 839

EN + हिं
GB The output of: int a[]={1,1,2,2,3}; cout<
IN इसका आउटपुट: int a[]={1,1,2,2,3}; अदालत
3 3
5 5
2 2
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) unique removes consecutive duplicates: {1,2,3,?,?}; 3 unique elements.
व्याख्या (हिन्दी) अद्वितीय लगातार डुप्लिकेट हटाता है: {1,2,3,?,?}; 3 अद्वितीय तत्व.
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 840

EN + हिं Easy
GB What is Big Theta of the best sort algorithm for general data?
IN सामान्य डेटा के लिए सर्वश्रेष्ठ सॉर्ट एल्गोरिदम का बिग थीटा क्या है?
O(n) पर)
O(n log n) ओ(एन लॉग एन)
O(n^2) ओ(एन^2)
O(log n) ओ(लॉग एन)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Lower bound for comparison sorts is Omega(n log n).
व्याख्या (हिन्दी) तुलना प्रकारों के लिए निचली सीमा ओमेगा (एन लॉग एन) है।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Easy"। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।