Array in Data Structure in Hindi | ????????? ???????????? ??????, ?????????????????? ?????? ???????????????
?????? ??????????????? ??????????????? ?????????, ?????? array ?????? ???????????????????????? ????????? ????????? ??????????????? ???????????? ???????????? ?????? ???????????? Array ???????????? ???????????? ??????, ???????????? ??????????????????????????? ????????? - ????????? ?????? ??????, ?????? ???????????? ?????????????????? ????????? - ????????? ?????? ????????? ???????????? ??????????????? ????????? ?????? ????????? ?????? ?????? ??????????????? ?????? ??????????????? ???????????? ????????? ?????? ?????? ??????????????? ????????? ??????????????? ???????????? ???????????? ????????? ?????? ???????????? ???????????? ???????????? ?????????
What is Array in Data Structure in Hindi - ???????????? ?????????????????? ????????? ????????? ???????????? ???????
Array ?????? non-primitive linear data structure ?????? ?????? ?????? ???????????? data type ?????? elements ?????? ?????? ????????? ???????????? continuous ?????????????????? ??????????????? ????????? store ???????????? ????????? Array ?????? elements ?????? ???????????? position (index) ?????? ??????????????? competence access ???????????? ?????? ???????????? ?????????
Array ?????? ?????? ?????? ?????? apartment building ?????? ????????????????????? ?????? ????????? ???????????? ????????? ??????????????? ?????? ?????? ??????????????? ?????? ?????? ???????????? ???????????? ???????????? ??????, ?????? ???????????? ?????? ?????? ???????????? ?????? ???????????? (resident) ?????? ???????????????????????? ???????????? ????????? ??????????????? ?????? Floors ???????????? ?????? ?????? ?????? ?????? ????????? ?????? ???????????? sequential order ????????? stacked ???????????? ????????? ????????? ???????????? ???????????? ??????????????? ?????? ???????????? ????????? ??????, ?????? ?????? ???????????? ???????????? ????????? ?????? confusion ?????? ??????????????? ?????? ????????? ????????? ???????????? ?????? ?????? ????????? ?????? ???????????? ???????????? ?????? ????????????????????? ?????????
??????????????? ?????????????????? ????????? ???????????? ????????? ?????? ????????? ?????? fixed ?????? sequential structure ???????????? ??????, ??????????????? ?????? ???????????? ???????????? ?????? ???????????? index ?????? ???????????? ?????? ??????????????? ?????? locate ?????? ???????????? ????????? ??????????????? ???????????? ???????????? ????????????????????? ?????? memory address (Base value) ?????? ???????????????????????? ?????? ???????????? (offset) ?????? ??????????????? ???????????? ???????????? ?????? ????????????????????? ?????? memory location ?????? efficiently ?????????????????????????????? ???????????? ?????? ???????????? ?????????
Key Features of Array in Hindi - ????????? ?????? ??????????????? ??????????????????????????????
Fixed Size:
????????? ?????? ????????? ????????? ????????? (array) create ?????? ???????????? ?????? ?????? ???????????? ????????? ???????????? size change ???????????? ???????????? ?????? ???????????? ????????? ??????????????? ?????? ?????? ?????? ????????? ???????????? ?????? ?????? ????????? ???????????? ????????? ?????? ???????????? ?????????????????? ???????????? ???????????? ??????????????? ???????????? ?????????
Same Data Type:
????????? ?????? ???????????? ?????? ???????????? ??????????????? ?????? elements stored ???????????? ?????? ?????? ????????? ?????? ?????? ???????????? ???????????? ?????? ???????????? ????????? ??????????????????: Integers, floats, characters, ????????????
Continuous Memory Allocation:
????????? ?????? ?????? elements ???????????? ?????? ?????? memory ????????? ?????? continuous block ????????? ??????????????? ???????????? ??????, ?????? ???????????? ?????????????????? ??????????????? ?????? ??????????????? ??????????????? ???????????? ?????????
Indexing:
????????? ?????? ?????? ?????? element ?????? ???????????? ?????? ??????????????? index ???????????? ?????? ?????? 0 ?????? ???????????? ???????????? ????????????????????? (???) ?????? ???????????? ?????????
Example:
????????? ?????? ????????? [10, 20, 30, 40] ?????? ?????? :
- 10 ?????? ??????????????? index 0 ????????????,
- ?????? 20 ?????? ??????????????? index 1 ????????????, ?????? ????????? ????????? ????????? ?????? ??????????????????????????? ?????? ??????????????? index ???????????? ?????????
Types of Arrays in Hindi - ????????? ?????? ?????????????????????
????????? ????????????????????? ????????? ?????????????????? ?????? ???????????? ?????? :
- one-dimensional array.
- two-dimensional arrays.
- Multi-dimensional arrays.
1. 1-D (One dimensional) arrays:
One-dimensional ????????? ?????? ?????? ?????? ???????????? basic ?????? simple ????????? type ?????? ?????????????????? ??????????????? ?????? ?????? row ?????? ????????? ???????????? ????????? ?????? array ????????? elements ?????? ???????????? ?????? ?????? ?????? sequence ????????? ????????? ??????????????? ???????????? ?????????, ?????? ???????????? ?????? ?????? element ?????? ???????????? index ?????? ?????????????????? ?????? ?????????????????? ???????????? ?????? ???????????? ????????? ?????? arrays ?????? ??????????????? ?????? ???????????? ???????????? ?????? ?????? data linear ????????? ??????????????????: ???????????? student ?????? marks ?????? ????????? daily temperature readings.
One-dimensional Array
2. 2-D (Two dimensional) arrays:
Two-dimensional array ?????? ????????? ?????? matrix ?????? representation ???????????? ?????? ??????????????? rows ?????? columns ??????????????? ????????? ???????????? ????????? ??????????????? ?????? ?????? ????????????????????? ?????? row ?????? column index ?????? ?????????????????? ?????? ?????????????????? ???????????? ???????????? ????????? ?????? ????????? ?????? ???????????? ???????????? ?????????????????? ???????????? ?????? ?????? data tabular form ????????? ???????????? ???????????? ??????, ?????????????????? ?????? ????????? ???????????? ???????????? chessboard ?????? excel sheet ?????? ??????????????????????????? (represent) ???????????????
Two-Dimensional array
3. Multi-Dimensional (M-D) Array:
Multi-dimensional array ?????? ????????? ??????????????? ?????? ???????????? ?????? ?????? ?????? ?????? ?????????????????? dimensions ?????? ???????????? ??????????????? ???????????? ????????? ?????????????????? ?????? ????????? ???????????? ???????????? 3D game ?????? coordinates ?????? ?????? Rubik's cube ?????? positioning.
Multi-Dimensional Array in Hindi
Operations on Arrays in Hindi
- Traversal
- Insertion
- Deletion
- Searching
- Sorting
- Merging
- Reversing
1. Traversal
Traversal ?????? ?????? ???????????? ?????? ?????? ????????? ?????? ?????? ?????? element ?????? ?????? - ?????? ???????????? ???????????? sequentially access ??????????????? ?????? ?????????????????? ???????????? ???????????? ?????? ?????? ?????? ???????????? ?????? ????????? ?????? ???????????? ??????????????????????????? ?????? ???????????????????????? ????????????????????? ???????????? ?????? ????????? ???????????????????????? ???????????? ?????????
2. Insertion
Insertion ????????? ?????? ?????????????????? ?????? ???????????? specific position ?????? ?????? ????????? element add ???????????? ?????? ???????????? ????????? ??????????????? ?????? Fixed-size ????????? ???????????? ?????? ???????????????, ?????? element ?????? ????????? ????????? ??????????????? ?????? ????????? ??????????????????????????? ?????? shift ???????????? ??????????????? ??????, ??????????????? ????????? ?????? ????????? ?????? ???????????? ????????? Dynamic ????????? ?????? process ?????? simple ???????????? ????????????
3. Deletion
Deletion ?????? ???????????? ?????? ????????? ?????? ???????????? element ?????? remove ??????????????? ????????? ???????????? ????????? ???????????? ?????? ??????????????????????????? ?????? ??????????????? ???????????? ??????????????? ?????? ???????????? ?????????????????? continuity maintain ????????? ?????? ???????????? ?????? ?????????????????? ?????? ????????? ?????? ????????? ???????????? ???????????? ?????? ???????????? ?????????
4. Searching
Searching ?????? ???????????? ?????? ????????? ???????????? ??????, ?????? ?????? ?????? ????????? ?????? ??????????????? specific element ????????????????????? ?????? ?????? ????????????, ?????? ?????? ?????????????????? ?????? ?????? ?????????????????? ?????? ???????????? ?????? ???????????? ??????:
- Linear Search: Sequentially ???????????? ?????? - ?????? ???????????? ?????? ?????? element ?????? ????????? ???????????????
- Binary Search: ?????? ??????????????? sorted arrays ?????? ????????? ??????????????? ???????????? ??????, ?????? divide-and-conquer approach ?????? follow ???????????? ?????????
5. Sorting
Sorting ?????? ?????? ???????????? ?????? ?????? ????????? ?????? ???????????? ?????? elements ?????? ???????????? ascending ?????? descending order ????????? arrange ??????????????? ?????? ?????????????????? ???????????? ?????? ????????????????????? ?????? organize ?????? efficient ??????????????? ?????? ????????? ???????????? ??????????????? ??????:
- Bubble Sort: Adjacent ??????????????????????????? ?????? compare ?????? ??????????????? ???????????? ?????????
- Quick Sort: ?????? Divide-and-conquer ???????????? ?????? ??????????????? ?????? ??????????????? ???????????? ??????, ?????? pivot ????????????????????? ?????? around partitioning ???????????? ?????????
- Merge Sort: ?????? sorted sub-arrays ?????? ??????????????? ?????????, ????????? ?????? repeatedly ?????????????????? ?????? ???????????? ???????????? ?????????
6. Merging
Merging ?????? ???????????? ?????? ?????? ?????? ?????? ?????? ???????????? ???????????? sorted arrays ?????? ??????????????? ?????? ????????? sorted ????????? ?????????????????? ???????????? ??????????????? ???????????? ??????????????? purpose ?????? ??????, ?????? ???????????? ?????? efficiently organize ????????????, ?????? ??????????????? ??????????????? ?????? ????????? ??????????????? ?????? ?????? ???????????? elements ?????? ??????????????? ??????????????? ?????????????????? ???????????? ?????? ?????? operation ?????? ?????? ??????????????? divide-and-conquer algorithms, ???????????? merge sort, ????????? ????????? ??????????????? ???????????? ?????????
7. Reversing
Reversing ????????? ?????? ?????? ???????????? ?????? ?????? elements ?????? ??????????????? ????????????, ????????? ???????????? ????????? ???????????? ?????? ???????????? ????????????????????? ???????????? ?????? ?????? ??????????????? ?????????????????? ?????? ?????? ?????? ??????????????? ????????????????????? ???????????? ?????? ?????? ?????????????????? position ?????? ??????????????? ???????????? ?????????
Applications of the Array in Hindi
- ????????? ?????? ??????????????? CPU scheduling algorithms ?????? ????????? ???????????? ?????? ???????????? ?????????
- Sorting algorithms ?????? ?????? ???????????? ????????? data structure ?????? ??????????????? ???????????? implement ???????????? ?????? ???????????? ?????????
- ????????? ?????? ???????????????????????? matrices ?????? ???????????? ????????? ????????????????????????????????? ????????????????????????????????? ?????? solve ???????????? ?????? ????????? ???????????? ?????????
- Database ????????? ?????? records ??????????????? ???????????? ?????? ?????? ???????????? ????????? data structure ?????? ??????????????? ???????????? arrange ???????????? ???????????? ?????????
- Queue, Stack, HashMap, ?????????, ???????????? ??????????????? ???????????? ??????????????????????????? ?????? ?????? ????????? ?????? ?????????????????? ?????? implement ???????????? ???????????? ?????????
- ??????????????? ?????? ?????? ????????? ??????????????? ?????? ???????????? ????????? - ????????? variables ?????? ????????? ???????????? ?????? ???????????? ?????????
- ?????? ?????? ????????? elements ?????? ?????? ??????????????? ?????? ???????????? ?????? ??????????????? ???????????? ???????????? same ???????????? ?????????
Indexing in the array in Hindi
????????? ????????? Indexing ?????? ???????????? ?????? ???????????? ?????? ?????? ????????? ?????? ?????? ??????????????????????????? ???????????? ?????? ???????????? access ???????????? ?????? ????????? ?????????????????? identify ???????????? ?????? ????????? ???????????? ?????? position number ??????????????? ??????????????? ????????? ?????? ??????????????????????????? ??????????????? sequential memory locations ????????? ????????????????????? ???????????? ??????, ?????? ?????? ?????? ????????????????????? ?????? ???????????? ????????? ?????? ?????? unique index ???????????? ??????, ?????? ???????????? position ?????? ??????????????????????????? ???????????? ?????????
Types of Array Indexing in Hindi - ????????? ?????????????????????????????? ?????? ??????????????????
????????? indexing ?????? ?????????????????? ?????????????????????????????? ?????? ???????????? ??????:
0-based indexing
????????? ???????????? ????????? ?????? ?????? ???????????? ?????????????????? ?????? ??????, ?????? index `0` ?????? ??????????????? ???????????? ??????, ?????? ???????????? ?????????????????????????????? ?????? 0-based indexing ????????? ???????????? ????????? ???????????????????????? ??????????????? ?????? ???????????????????????????????????? languages ?????? ???????????? ??????, ???????????? - C, C++, Python, Java ????????? ?????? ????????? 0-based indexing ?????? ?????? ???????????? ???????????? ?????????
Example:
int arr[5] = {10, 20, 30, 40, 50};
arr[0] = 10
1-based indexing
????????? ???????????? ????????? ?????? ????????????????????? (index) `1` ?????? ???????????? ???????????? ?????? ?????? ???????????? 1-based indexing ????????? ???????????? ????????? ???????????? ?????? ???????????? ???????????? ?????? ?????? ????????? ?????? ?????? ???????????? ?????????????????? ?????? ????????? index-1 assign ???????????? ??????????????????
Example:
Array: [10, 20, 30, 40]
Index: 1 2 3 4
Index 1 ??? Value = 10
Index 3 ??? Value = 30
N-based indexing
?????? ?????? ????????? ???????????? ??????, ??????????????? ???????????? ???????????? index element ?????? ?????? ?????? ???????????? ?????? value ?????? start ?????? ????????????, ????????? ???????????? ?????? negative value ?????? ??????????????? ??? ??????, ?????? ????????? ?????? ????????? ?????? ?????? N-based indexing ????????? ???????????? ????????????
?????? ?????????????????? ?????? indexing ???????????? ?????????????????? flexibility ?????????????????? ???????????? ?????? ???????????? ?????? ?????? ????????? ?????? ???????????? ?????? ??????????????????????????? ?????? access ???????????? ?????? customized index range ?????? ?????????????????? ?????? ?????? ???????????? ?????????, ?????? ???????????? ?????? ?????? ?????? ????????????????????? ???????????? ???????????? ?????????
Example:
arr = {-2: 10, -1: 20, 0: 30, 1: 40}
arr[-2] = 10
arr[0] = 30
arr[1] = 40
Difference Between Array and Linked List in Hindi
| Feature | Array | Linked List |
|
Memory Allocation |
Continuous | non-continuous |
| Size | Fixed | Dynamic |
| Access Time | O(1) | O(n) |
| Insertion/Deletion | Slow (O(n)) | Fast (O(1) at head) |
| Cache Friendliness | High | Low |
Advantages of Array in Data Structure in Hindi - ???????????? ??????????????????????????? ????????? ????????? ?????? ????????????
- Random Access: ????????? ?????? ??????????????? ???????????? elements ?????? index ?????? ???????????? direct access ???????????? ?????? ???????????? ??????, ?????? retrieval ?????? ?????? ?????????????????? fast ??????????????? ?????? ?????? ???????????? time complexity O(1) ???????????? ?????????
- Efficient Memory Allocation: ????????? ?????? ?????????????????? ???????????? ?????? ?????????????????? locations ????????? ??????????????? ???????????? ???????????? ??????, ?????? memory ?????? ??????????????? ???????????? optimize ???????????? ?????? ?????? cache performance ?????? ?????? improve ???????????? ?????????
- Ease of Traversal: ????????? ????????? ?????? elements ???????????? ?????? ?????? sequentially ???????????? ?????? ?????? ????????? ?????? ?????? ????????? ????????? stored ???????????? ??????, ?????? ???????????? ?????? ?????????????????? traverse ???????????? ???????????? ???????????? ???????????? ?????????
- Fixed Size Data ?????? ????????? Best: ?????? ???????????? ???????????? ?????? ???????????? ???????????? ?????? ?????? ????????? ???????????? ??????, ?????? ????????? ?????? ??????????????? ???????????? ???????????? ?????????????????? stable ?????? efficient ???????????? ?????????
- Sorting ?????? Searching ?????? ????????? Useful: ????????? ?????? ?????????????????? ???????????? (binary search), ?????? ???????????? ?????? ???????????? ???????????? ??????????????? (merge sort) ?????? quicksort ????????? algorithms ?????? ????????? ??????????????? (easily) ?????? ??????????????? ???????????? ?????? ???????????? ??????, ?????? ???????????? versatile ???????????? ?????????
Disadvantages of Array in Data Structure in Hindi - ???????????? ??????????????????????????? ????????? ????????? ?????? ??????????????????
Fixed Size:
????????? ?????? ????????? ????????? ?????? ???????????? declare ?????? ???????????? ???????????? ?????? ?????? ???????????? ????????? ????????? ???????????? ???????????? ?????? ??????????????? ???????????? ??????????????? ????????? ????????? ?????? ???????????? ?????????????????? ????????? ?????? ?????? ?????????????????? ?????????????????? (waste) ???????????? ??????, ?????? ????????? ?????? ???????????? ?????? ???????????? ?????? ?????? memory overflow ?????? ???????????? ?????????
Insertion ?????? Deletion ?????? Complexity:
????????? ????????? ????????? ???????????? ???????????? ?????? ??????????????? ?????? ????????? ?????? ????????? ?????? ????????? ????????? ????????? element insert ?????? delete ???????????? ??????, ?????? ???????????? ???????????? ???????????? ????????? elements ???????????? ????????? ?????? shift ???????????? ???????????? ??????, ?????? O(n) time ???????????? ?????????
Inefficient Memory Usage:
????????? ???????????? ????????? ?????? ???????????? declared ???????????? ????????????????????? ???????????? ?????? ???????????? ?????????????????? ????????? ??????, ?????? unused ?????????????????? ?????? ????????? ?????? efficiency ????????? ?????? ???????????? ?????????
Contiguous Memory Requirement:
????????? ?????? ?????? ???????????? ????????? ?????? ????????? contiguous ?????????????????? ??????????????? ?????? ?????????????????? ???????????? ????????? ???????????? ????????? ???????????? ???????????? ?????? ????????? memory available ???????????? ?????? ????????? ??????, ?????? allocation problem ???????????? ?????? ???????????? ?????????
Lack of Flexibility:
????????? ?????? dynamically resize ???????????? ??????????????? (possible) ???????????? ???????????? ??????, ?????? ?????? complex relationships ?????? ????????????????????? ????????? ?????? inefficient ???????????? ????????? ????????? ????????? ?????? linked lists ?????? ????????? dynamic arrays ?????? ?????? ?????? ???????????? ?????????????????? flexible ???????????? ?????????
???????????????????????? (Conclusion)
?????? ?????? ????????? ?????? ??????????????? ?????? Array ???????????? ??????, ???????????? ???????????????????????????, ?????????????????? ?????? ??????????????? ???????????? ???????????? ????????? ?????? DSA ????????? ????????? ?????????, ?????? Array ???????????? ?????? ???????????? ??????????????? ??????????????? ????????? ?????? ????????? ??????????????? ?????? ??????????????? Sorting, Searching ?????? Advanced Data Structures ???????????? Stack, Queue, Linked List ?????? ?????? ??????????????? ?????? ????????? ????????????????????? ????????? ???????????? ?????? ????????? Array ?????? ??????????????? ????????? ???????????? ?????? ?????? ?????? ???????????? Comment ????????? ????????? ???????????? ????????????
FAQs
Q1: Array ???????????? ???????????? ???????
Ans: Array ?????? non-primitive linear data structure ?????? ?????? ?????? ???????????? data type ?????? elements ?????? continuous memory block ????????? store ???????????? ?????????
Q2: Array ?????? ??????????????? ?????????????????? ???????????? ??????????
Ans: Array ??????????????? ????????? ?????? ????????? ?????????????????? ?????? ???????????? ????????? ??? One Dimensional, Two Dimensional ?????? Multi-Dimensional Arrays???
Q3: Array ?????? ???????????? ???????????? ??????????????? ???????????? ???????
Ans: Array ????????? elements ?????? ???????????? index ?????? ???????????? O(1) complexity ????????? direct access ???????????? ?????? ???????????? ?????????
Q4: Array ?????? ???????????? ???????????? limitation ???????????? ???????
Ans: Array ?????? size fix ???????????? ?????? ?????? insertion/deletion operations ????????? ???????????? ???????????? (O(n)) ???????????? ????????????
Q5: Array ?????? Linked List ????????? ???????????? ???????????? ???????
Ans: Array ????????? continuous memory allocation ???????????? ?????? ???????????? Linked List ????????? elements scattered memory ????????? pointers ?????? ???????????? store ???????????? ????????????