Delete an Element From Array (Concept + Java Code) | DSA using Java #4

Delete an Element From Array (Concept + Java Code) | DSA using Java #4

ForMyScholars

2 года назад

39,906 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

shubham saurabh
shubham saurabh - 22.08.2023 13:49

luv u

Ответить
alveera
alveera - 09.08.2023 14:27

for(int i=0;i<n-1;i++)
{
if(i<index)
{
b[i]=a[i];
}
else if(i==index || i>index)
{
b[i]=a[i+1];
}
}

Ответить
Mr.Minimal
Mr.Minimal - 01.08.2023 06:22

Mam, muze doubt hai. Aapne array B ko print kiya hai. Array A se element delete hua hi nahi.

Ответить
Amarnath
Amarnath - 02.07.2023 09:36

please try not explain in index values , explain in position values(user perspective).And nice video

Ответить
ARSHAD KHAN
ARSHAD KHAN - 03.05.2023 16:27

MAM please upload your code on git

Ответить
kshitij nimkar
kshitij nimkar - 02.03.2023 15:22

Can you share the source code for each video ? @ForMyScholars

Ответить
Parth Tagadpallewar
Parth Tagadpallewar - 18.02.2023 22:38

// better code

for(i=0;i<n-1;i++)
{
if(i<m)
arr2[i]=arr[i];
else
arr2[i]=arr[i+1];
}

Ответить
Jyoti Sekhar Panda
Jyoti Sekhar Panda - 13.02.2023 18:18

Thankyou mam.I have been trying to understand this logic for 1 year but I was unable to understand but after watching your video I can able to understand in 💯 %

Ответить
Chalo kuchh krte han
Chalo kuchh krte han - 12.02.2023 08:45

Thanks di

Ответить
Validation_Feature_K⚡⚡
Validation_Feature_K⚡⚡ - 08.02.2023 10:24

Here is another method mentioned by you @ForMyScholars , by using Existing Array :
Scanner vfk =new Scanner(System.in);
System.out.println("Enter no of elements : ");
int n=vfk.nextInt();
int a[] = new int[n];
for (int i=0;i<n;i++)
{
System.out.println("Enter element no."+i+": ");
a[i]=vfk.nextInt();
}
System.out.println("Elements are");
for (int i=0;i<n;i++)
{
System.out.print(a[i]+" ");
}
System.out.println(" ");
System.out.println("Enter index to be deleted :");
int ind=vfk.nextInt();
for (int i=0;i<n-1;i++)
{
if (i==ind||i>ind)
{
int temp=a[i+1];
a[i]=temp;
}
}
for (int i=0;i<n-1;i++)
{
System.out.print(a[i]+ " ");
}
Thanks For this DSA Course😊😊

Ответить
p salmaan
p salmaan - 25.12.2022 21:28

In the last "else" part
Can't we write
B[ i ] = a[ i + 1] ;

Ответить
Risvan Mp
Risvan Mp - 24.12.2022 11:54

What is a.length . this veriable ka value kithna

Ответить
Ashish Nepal
Ashish Nepal - 19.11.2022 06:49

good content and understandable explanation. keep it up

Ответить
Priyanshu Khandelwal
Priyanshu Khandelwal - 07.09.2022 20:56

Nice explanation

Ответить
Raid Eye
Raid Eye - 14.08.2022 07:52

Can you show it by using SC O(1)?

Ответить
Pinki Kumari
Pinki Kumari - 01.05.2022 18:34

Mam using continue statement element is skipped but not deleted from memory. plzz let me know mam .

Ответить
Navya Bharat
Navya Bharat - 23.01.2022 09:48

jitni tarif kri jae km h itna best explaination aaj tk khi nhi dekha copy pr fir code pr hi input leke wah mja aa gya

Ответить
Parmar Suresh
Parmar Suresh - 10.01.2022 10:23

Ma'am we can do insert, update, delete only use one array through don't need to create a second array.

Ответить
Divakar Pandey
Divakar Pandey - 27.12.2021 19:38

Quality content♥️

Ответить
HEAVEN POSTMAN
HEAVEN POSTMAN - 08.08.2021 08:41

Mam video upload kro is week nhi aayi h

Ответить
CodeCrew
CodeCrew - 19.07.2021 22:12

Ma'am videos are very good please increase the videos upload frequency

Ответить
jigar sharma
jigar sharma - 16.07.2021 18:50

जिस तरह हम इंटरनेट से सॉफ्टवेयर डाउनलोड कर के इंस्टॉल करने के बाद उसे use करते है
उसी तरह हम चाहते है की c language me simple calculator बनया है वह एक सॉफ्टवेयर की तरह हो जाए की कोई इंस्टॉल करने के बाद उसे use कर सके
Please bataiye ma'am 🙏🙏🙏

Ответить