टॉपिक
Array क्या है? (What is Array in Hindi)
- Array एक non-primitive और Linear डेटा स्ट्रक्चर है।
- Array एक ऐसा समूह (Collection) होता है जिसमें एक ही प्रकार (Same Type) के कई data elements एक साथ store किए जाते हैं।
- Array में सभी elements एक के बाद एक sequence (क्रम) में store होते हैं।
- Array के हर element का एक index (position) होता है, जिसकी मदद से हम उसे आसानी से access कर सकते हैं।
- Array में डेटा continuous memory location में स्टोर होता है, जिससे डेटा को access करना fast होता है।
- Array की size आमतौर पर पहले से fixed (निर्धारित) होती है, यानी इसे बाद में आसानी से बढ़ाया या घटाया नहीं जा सकता।
- Array सबसे basic और महत्वपूर्ण data structure में से एक है, जिसका इस्तेमाल लगभग हर programming language में किया जाता है।
Array के प्रकार (Types of Array in Hindi)
Array तीन प्रकार का होता है।
- One Dimensional Array (1-D)
- Two Dimensional Array (2-D)
- Multi Dimensional Array (M-D)
1:- One Dimensional Array (1-D)
जिस array में केवल एक subscript (index) होता है, उसे One Dimensional Array कहते हैं। इसका इस्तेमाल data को एक linear form (एक सीधी रेखा) में store करने के लिए किया जाता है।
उदाहरण (Example) –
Marks = [10, 20, 30, 40]

2:- Two Dimensional Array (2-D)
जिस array में दो subscripts (row और column) होते हैं, उसे Two Dimensional Array कहते हैं। इसे matrix या table के रूप में भी समझा जा सकता है।
उदाहरण (Example):
[ [1, 2],
[3, 4] ]

3:- Multi Dimensional Array (M-D)
जिस array में दो से अधिक subscripts (indices) होते हैं, उसे Multi Dimensional Array कहते हैं। यह 3D या उससे अधिक dimensions में data को store करने के लिए उपयोग होता है।
उदाहरण (Example):
[
[[1,2],[3,4]],
[[5,6],[7,8]]
]

Array की विशेषताएं (Features of Array in Hindi)
Array की विशेषताएं निम्नलिखित हैं:-
1. Homogeneous Data Types (एकसमान डेटा टाइप)
Array की सबसे बड़ी विशेषता यह है कि इसमें केवल एक ही प्रकार (Same Type) का data स्टोर किया जाता है।
अगर आपने Integer array बनाया है, तो उसमें सिर्फ numbers (जैसे 10, 20, 30) ही store होंगे। आप उसमें text (नाम) या अन्य type का data स्टोर नहीं कर सकते।
2. Contiguous Memory Allocation
Array में डेटा memory में एक के बाद एक (continuous) स्टोर होता है।
इसका फायदा यह है कि data को ढूँढना और access करना बहुत fast होता है, जिससे program की performance अच्छी रहती है।
3. Fixed Size / Static Structure
Array एक static data structure होता है। इसका मतलब है कि program लिखते समय ही हमें इसका size तय करना होता है (जैसे 10, 50, 100)। Program run होने के बाद हम इसका size आसानी से बदल नहीं सकते।
4. Index Based Access
Array में हर element की एक position होती है, जिसे index कहते हैं। Index हमेशा 0 से शुरू होता है। अगर size 5 है, तो index 0 से 4 तक होगा।
5. Direct / Random Access
Index की वजह से हम किसी भी element को सीधे access कर सकते हैं। जैसे अगर हमें 5वां element चाहिए, तो हम सीधे Array[4] लिखकर उसे प्राप्त कर सकते हैं। हमें पहले के elements को check करने की जरूरत नहीं होती।
1D, 2D और 3D Array में अंतर (Difference between 1D, 2D & 3D Array in Hindi)
Arrays के इन तीनों प्रकारों को आसानी से समझने के लिए नीचे table दी है:-
| तुलना का आधार (Basis) | 1D Array (One Dimensional) | 2D Array (Two Dimensional) | 3D Array (Multi Dimensional) |
| Subscripts | इसमें डेटा को स्टोर करने के लिए केवल एक Subscript [ ] का उपयोग होता है। | इसमें दो Subscript [ ][ ] (Row और Column) का उपयोग होता है। | इसमें तीन या अधिक Subscript [ ][ ][ ] का उपयोग होता है। |
| आकार (Structure) | यह देखने में एक सीधी लिस्ट (Linear List) की तरह होता है। | यह एक टेबल या मैट्रिक्स (Matrix) की तरह होता है। | यह ‘Tables के समूह’ (Cube या 3D ब्लॉक) की तरह होता है। |
| सिंटैक्स (Syntax) | int arr[5]; | int arr[3][4]; | int arr[2][3][4]; |
| जटिलता (Complexity) | इसे समझना और प्रोग्राम में इस्तेमाल करना सबसे आसान है। | यह 1D की तुलना में थोड़ा जटिल (Complex) होता है। | इसे समझना और मेमोरी में मैनेज करना सबसे ज्यादा कठिन होता है। |
| उपयोग (Use) | इसका इस्तेमाल रोल नंबर की लिस्ट, एक विषय के Marks या नाम स्टोर करने के लिए किया जाता है। | इसका इस्तेमाल गणित के Matrix को हल करने, शतरंज बोर्ड या Excel टेबल जैसा डेटा बनाने के लिए किया जाता है। | इसका इस्तेमाल 3D ग्राफिक्स, मौसम की भविष्यवाणी का डेटा या coordinates (x,y,z) के लिए किया जाता है। |
निवेदन:- अगर आपके लिए “What is Array in Hindi & Types” की यह पोस्ट Helpful रही हो, तो हमें Comment के माध्यम से जरूर बताइए। आपके Comments हमें और अच्छा लिखने के लिए प्रेरित (motivate) करते हैं। कृपया इस पोस्ट को अपने दोस्तों के साथ Share अवश्य करें। धन्यवाद!
Good platform for programming students
very nice
Good
What is initlalizing two dimensional Arrey
int arr[][] = { {1,2} , {3,4} }; // Initialization
int arr[][]; or int [][] arr; or int[]arr[]; //Declaration
int arr[][]=new int[2][2]; or int[][]arr=new int[2][2]; or int[]arr=new int[2][2]; //Creation
I m very happy this site is wonderful
Thanks nishank for your kind words for this site…keep learning
Bhut badiya or esey way main samja Diya thank u so much
this website helps me a lot of in my O LEVEL exams.
i am so thankful to you SIR.
thanks prabhat for your valuable comment.. It was nice to hear that you got help from this website. This is a big deal for me.
VBA ka bhi notes banakar net par upload kare
Really helpfully website
some importantant topics for IMED SUBJECT in hindi
i can’t understood plz example this array 1D
Deadlock handling and avoidance ko hindi me explain kr dijiye
Deadlock handling and avoidance Explaine kr dijiye
Thank you bro
Very easy and wonderful
I m glade of this site
Thank you so much sir to uploading of this site
Sup eerb
it is good enough for the BCA students to understand their problem in c language.
Thank you
Thanks for this.this is very useful
Nice and thanks
Thanku so much sir
Very helpful content sir
Excellent
Wow… amazing…
Sir please please thrashing ke bare m bta dijiye ek bar
Algorithms of aarays
Thank you so much
Nice .notes ho to esi.
Hindi English mix.
Bahot Dino se esi notes search kr rha tha C language ka.aaj Mila.
Thank you Team.