6.7 DEMERITS OF ARRAYS

6.7 এৰেৰ ডিএমিৰিট

We have seen usages of arrays in solving several problems. In this section, let us see some of the demerits of arrays.

আমি কেইবাটাও সমস্যা সমাধানত এৰেৰ ব্যৱহাৰ দেখিছোঁ। এই শাখাত, আমি এৰেৰ কিছুমান দোষ চাওঁ আহক।

Though array has a huge usefulness, it has some limitations as well. Let us list them below.

যদিও এৰেৰ এক বৃহৎ উপযোগিতা আছে, ইয়াৰ কিছুমান সীমাবদ্ধতাও আছে। আমি সেইবোৰ তলত তালিকাভুক্ত কৰোঁ আহক।

1. Fixed size

স্থিৰ আকাৰ

2. Homogenous data

সমগোত্ৰীয় তথ্য

3. Contiguous storage

সংলগ্ন সংগ্ৰহ

Fixed size: We have already seen that before using an array, we must declare it with a size. This is the capacity of the array. If some requirement arises (at run time)n to store more elements in that array, we cannot do so. For instance, in an integer array with size 10, we cannot store 11 integers.

স্থিৰ আকাৰ: আমি ইতিমধ্যে দেখিছোঁ যে এৰে এটা ব্যৱহাৰ কৰাৰ আগতে, আমি ইয়াক এটা আকাৰৰ সৈতে ঘোষণা কৰিব লাগিব। এয়া হৈছে এৰেৰ ক্ষমতা। যদি সেই এৰেত অধিক উপাদান সংৰক্ষণ কৰাৰ বাবে কিছু প্ৰয়োজনীয়তা (দৌৰা সময়ত) উদ্ভৱ হয়, আমি এনে কৰিব নোৱাৰো। উদাহৰণ স্বৰূপে, 10 আকাৰৰ এটা ইণ্টেগাৰ এৰেত, আমি 11 টা ইণ্টেগাৰ সংৰক্ষণ কৰিব নোৱাৰো।

Homogeneous data: We know that an array is a collection of similar types of data. We cannot store a float variable in an integer array.

সমগোত্ৰীয় ডাটা: আমি জানো যে এৰে হৈছে একে ধৰণৰ ডাটাৰ সংগ্ৰহ। আমি এটা ফ্লোট ভেৰিয়েবল এটা ইণ্টেগাৰ এৰেত সংৰক্ষণ কৰিব নোৱাৰো।

Contiguous storage: The elements in an array are stored in contiguous memory locations – one after another. We cannot simply delete an element or add an element in an arbitrary location.

সংলগ্ন সংৰক্ষণ: এৰেএটাৰ উপাদানবোৰ সংলগ্ন মেম’ৰী অৱস্থানত সংৰক্ষণ কৰা হয় – এটাৰ পিছত এটা। আমি কেৱল এটা উপাদান বিলোপ কৰিব নোৱাৰো বা এটা স্বেচ্ছাচাৰী স্থানত এটা উপাদান যোগ কৰিব নোৱাৰো।

Figure 6.8 explains this with an example. Suppose, an array stores ‘SEBAASSAM’ and we want to put a space in between SEBA and ASSAM. Then, all the characters from indices 8, 7, 6, 5 and 4 have to be shifted toward the right side. This is a costly operation.

চিত্ৰ 6.8-এ এটা উদাহৰণৰ সৈতে এইটো ব্যাখ্যা কৰে। ধৰি লওঁক, এটা এৰে ‘চেবাঅসম’ সংৰক্ষণ কৰে আৰু আমি ছেবা আৰু অসমৰ মাজত এটা স্থান ৰাখিব বিচাৰো। তাৰ পিছত, সূচক 8, 7, 6, 5 আৰু 4-ৰ সকলো চৰিত্ৰ সোঁফাললৈ স্থানান্তৰ কৰিব লাগিব। এইটো এটা ব্যয়বহুল অপাৰেচন।

In this chapter, we have learned about arrays and its usages along with some limitations. We have solved a good number of problems and written programs in C. Another set of problems are given in the Exercise. We also highly encourage the students to think of some variations of the problems and then try to develop solution strategies for the same. Finally, they should try to write programs.

এই অধ্যায়ত, আমি কিছুমান সীমাবদ্ধতাৰ সৈতে এৰে আৰু ইয়াৰ ব্যৱহাৰৰ বিষয়ে শিকিছোঁ। আমি চি-ত ভালসংখ্যক সমস্যা আৰু লিখিত কাৰ্যসূচী সমাধান কৰিছো। ব্যায়ামটোত আন এক সমস্যা ৰখা হৈছে। আমি শিক্ষাৰ্থীসকলক সমস্যাবোৰৰ কিছু পৰিৱৰ্তনৰ কথা ভাবিবলৈ আৰু তাৰ পিছত ইয়াৰ বাবে সমাধান ৰণনীতি বিকশিত কৰিবলৈ চেষ্টা কৰিবলৈ ও যথেষ্ট উৎসাহিত কৰোঁ। অৱশেষত, তেওঁলোকে প্ৰ’গ্ৰাম লিখিবলৈ চেষ্টা কৰিব লাগে।