Interactive Guide to Arrays অ্যারে পরিচিতি

What is an Array? অ্যারে কী?

An array is a fundamental data structure used to store a collection of elements of the same type in a contiguous block of memory. Each element is accessible via an index, starting from 0. Below is a visual representation of a simple integer array. অ্যারে হলো একটি মৌলিক ডেটা স্ট্রাকচার যা একই ধরনের একাধিক উপাদানকে মেমোরির একটি সংলগ্ন ব্লকে সংরক্ষণ করতে ব্যবহৃত হয়। প্রতিটি উপাদানকে একটি সূচক (index) দ্বারা অ্যাক্সেস করা যায়, যা ০ থেকে শুরু হয়। নিচে একটি সাধারণ ইন্টিজার অ্যারের ভিজ্যুয়াল উপস্থাপনা দেওয়া হলো।

Hover over an element to see its value and index. একটি উপাদানের উপর হোভার করে তার মান এবং সূচক দেখুন।

Key Characteristics প্রধান বৈশিষ্ট্য

Fixed Sizeনির্দিষ্ট আকার

The size of an array is determined at declaration and cannot be changed.অ্যারের আকার ঘোষণার সময় নির্ধারিত হয় এবং পরিবর্তন করা যায় না।

Homogeneous Elementsএকই ধরনের উপাদান

All elements in an array must be of the same data type.অ্যারেতে থাকা সব উপাদানকে অবশ্যই একই ডেটা টাইপের হতে হবে।

Zero-Based Indexingশূন্য-ভিত্তিক সূচক

The first element is at index 0, the second at index 1, and so on.প্রথম উপাদানের সূচক হলো ০, দ্বিতীয়টির ১, এবং এভাবেই চলতে থাকে।

Example in C সি ভাষায় উদাহরণ

#include <stdio.h> int main() { int numbers[5] = {10, 20, 30, 40, 50}; // Access the first element (index 0) printf("First element: %d\n", numbers[0]); return 0; } // Output: 10

Interactive Array Operations ইন্টারেক্টিভ অ্যারে অপারেশন

Explore common array operations. Select an operation to see a visual demonstration, the corresponding C code, and its time complexity. Interact with the controls to see how the array changes. সাধারণ অ্যারে অপারেশনগুলো অন্বেষণ করুন। একটি ভিজ্যুয়াল প্রদর্শনী, সংশ্লিষ্ট সি কোড এবং এর টাইম কমপ্লেক্সিটি দেখতে একটি অপারেশন নির্বাচন করুন। অ্যারে কীভাবে পরিবর্তিত হয় তা দেখতে কন্ট্রোলগুলোর সাথে ইন্টারঅ্যাক্ট করুন।

Time Complexityটাইম কমপ্লেক্সিটি

Time complexity measures how the runtime of an operation grows with the input size (n). টাইম কমপ্লেক্সিটি পরিমাপ করে যে একটি অপারেশনের রানটাইম ইনপুটের আকারের (n) সাথে কীভাবে বৃদ্ধি পায়।

Multidimensional Arrays বহুমাত্রিক অ্যারে

A multidimensional array is an array of arrays. The most common is a 2D array, which can be thought of as a grid or a matrix. Hover over the cells to see their indices. একটি বহুমাত্রিক অ্যারে হলো অ্যারে এর একটি অ্যারে। সবচেয়ে সাধারণ হলো 2D অ্যারে, যা একটি গ্রিড বা ম্যাট্রিক্স হিসাবে ভাবা যেতে পারে। সেলগুলোর উপর হোভার করে তাদের সূচক দেখুন।

Visualizing a 3x3 Matrix একটি ৩x৩ ম্যাট্রিক্সের ভিজ্যুয়ালাইজেশন

Example in C সি ভাষায় উদাহরণ

#include <stdio.h> int main() { int matrix[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} }; // Access element at row 1, col 2 printf("Element at [1][2]: %d\n", matrix[1][2]); return 0; } // Output: 6