filmov
tv
Find an Element / Value from an given Array and Delete that Element with User Defined Function

Показать описание
Deleting Elements in an Array | Array Operations
The program will ask the user to enter the size of the array and then the elements of the array and store it in n and &arr[i].
Ask the user to enter the index of the element to be deleted.
Loop through the array and delete the element from the array.
Print the array.
In this video, we will look into deletion operation in an Array, i.e., how to delete an element from an Array, such as:
Deleting Elements from an Array when it is Unsorted
Deleting Elements from an Array when it is Sorted
Deleting Elements in an Array when it is Unsorted
In the delete operation, the element to be deleted is searched using the linear search, and then the delete operation is performed followed by shifting the elements.
Array before deletion
10 50 30 40 20
Array after deletion
10 50 40 20
Time Complexity: O(N)
Auxiliary Space: O(1)
Deleting Elements in an Array when it is Sorted
In the delete operation, the element to be deleted is searched using binary search, and then the delete operation is performed followed by shifting the elements.
Output
Array before deletion
10 20 30 40 50
Array after deletion
10 20 40 50
Time Complexity: O(N). In the worst case all elements may have to be moved
Auxiliary Space: O(log N). An implicit stack will be used
------------------------------------------
অ্যারে কি? ( what is array in c ? )
অ্যারে কি? অ্যারে (array) হল একই টাইপের একাধিক ভেরিয়েবল এর সংগ্রহ যা মেমরির কাছাকাছি লোকেশনে ডাটা স্টোর করে।
সি প্রোগ্রামিং ল্যাঙ্গুয়েজে প্রাপ্ত ডেটা টাইপ যা ইন্টিজার, কেরেক্টার, ফ্লোট, ডাবল ইত্যাদি সংরক্ষণ করতে পারে।
এতে পয়েন্টার, স্ট্রাকচার, এবং লিংক লিস্ট আকারে ডেটা সঞ্চয় করার ক্ষমতাও রয়েছে। অ্যারে হল সহজ ডেটা স্ট্রাকচার যেখানে প্রতিটি ডাটা উপাদানকে এর সূচী নম্বর ব্যবহার করে এলোমেলোভাবে অ্যাক্সেস করা যায়।
আমরা একটি বড় সুবিধা পাব তা হল, int a, b, c; এই ভাবে ভেরিয়েবল ঘোষনা করতাম এখন এক লাইনে এই ভাবে int array[3]; লিখে তিনটি ভেরিয়েবল ঘোষনা করতে পারব।
সেগুলি হল, array[0], array[1], array[2] এ মানে আমরা তিনটি ভেরিয়েবল পেয়ে গেছি, কিন্তু ঘোষনার সময় যে অ্যারের ভিতরে ৩ দিসিলাম int array[3]; এটা অ্যারে সাইজ। int এর পরে যা লিখেছি তা অ্যারের নাম।
সিনটেক্স : data_type array_name[array_size];
Regards,
Md. Ahsan Arif
University of Scholars
#cprogramming #education #ius #universityofscholars #ius #coding #cprogrammingtutorial #trustcoding #banglatutorial #bangladesh #bangla #array #arrayinc #foryou #studentprotest #quotamovement #banglablockade #quotareform #quotaandolon #quotadebate #antiquotamovement #updatenews #breakingnews #newsupdate #trending #latestnews #bangladeshinews #অ্যারে #প্রোগ্রামিং #প্রোগ্রাম
The program will ask the user to enter the size of the array and then the elements of the array and store it in n and &arr[i].
Ask the user to enter the index of the element to be deleted.
Loop through the array and delete the element from the array.
Print the array.
In this video, we will look into deletion operation in an Array, i.e., how to delete an element from an Array, such as:
Deleting Elements from an Array when it is Unsorted
Deleting Elements from an Array when it is Sorted
Deleting Elements in an Array when it is Unsorted
In the delete operation, the element to be deleted is searched using the linear search, and then the delete operation is performed followed by shifting the elements.
Array before deletion
10 50 30 40 20
Array after deletion
10 50 40 20
Time Complexity: O(N)
Auxiliary Space: O(1)
Deleting Elements in an Array when it is Sorted
In the delete operation, the element to be deleted is searched using binary search, and then the delete operation is performed followed by shifting the elements.
Output
Array before deletion
10 20 30 40 50
Array after deletion
10 20 40 50
Time Complexity: O(N). In the worst case all elements may have to be moved
Auxiliary Space: O(log N). An implicit stack will be used
------------------------------------------
অ্যারে কি? ( what is array in c ? )
অ্যারে কি? অ্যারে (array) হল একই টাইপের একাধিক ভেরিয়েবল এর সংগ্রহ যা মেমরির কাছাকাছি লোকেশনে ডাটা স্টোর করে।
সি প্রোগ্রামিং ল্যাঙ্গুয়েজে প্রাপ্ত ডেটা টাইপ যা ইন্টিজার, কেরেক্টার, ফ্লোট, ডাবল ইত্যাদি সংরক্ষণ করতে পারে।
এতে পয়েন্টার, স্ট্রাকচার, এবং লিংক লিস্ট আকারে ডেটা সঞ্চয় করার ক্ষমতাও রয়েছে। অ্যারে হল সহজ ডেটা স্ট্রাকচার যেখানে প্রতিটি ডাটা উপাদানকে এর সূচী নম্বর ব্যবহার করে এলোমেলোভাবে অ্যাক্সেস করা যায়।
আমরা একটি বড় সুবিধা পাব তা হল, int a, b, c; এই ভাবে ভেরিয়েবল ঘোষনা করতাম এখন এক লাইনে এই ভাবে int array[3]; লিখে তিনটি ভেরিয়েবল ঘোষনা করতে পারব।
সেগুলি হল, array[0], array[1], array[2] এ মানে আমরা তিনটি ভেরিয়েবল পেয়ে গেছি, কিন্তু ঘোষনার সময় যে অ্যারের ভিতরে ৩ দিসিলাম int array[3]; এটা অ্যারে সাইজ। int এর পরে যা লিখেছি তা অ্যারের নাম।
সিনটেক্স : data_type array_name[array_size];
Regards,
Md. Ahsan Arif
University of Scholars
#cprogramming #education #ius #universityofscholars #ius #coding #cprogrammingtutorial #trustcoding #banglatutorial #bangladesh #bangla #array #arrayinc #foryou #studentprotest #quotamovement #banglablockade #quotareform #quotaandolon #quotadebate #antiquotamovement #updatenews #breakingnews #newsupdate #trending #latestnews #bangladeshinews #অ্যারে #প্রোগ্রামিং #প্রোগ্রাম