Insert a node in a Singly Linked List at a given position (Implementation)

Insert a node in a Singly Linked List at a given position (Implementation)

Dinesh Varyani

3 года назад

31,933 Просмотров

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


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

@abhishekpatel6020
@abhishekpatel6020 - 19.11.2023 15:34

What will happen if we add at certain position like 5 when list is empty

Ответить
@FashionTales1
@FashionTales1 - 29.03.2023 08:53

I see many people learning DSA with C/C++, but I decided to learn it in JAVA for full stack development related opportunities. But the resources are very few for DSA in JAVA😶 Luckily I found this🤞. Thank you so much sir for giving some hope for many people like me...! Lastly, Thanks for spreading this Knowledge instead of selling it🤩👏👏👏. I will definitely share this with many👍
- Samanvitha : )

Ответить
@dhruvipaliwal8961
@dhruvipaliwal8961 - 06.11.2022 11:25

You made dsa easy to understand

Ответить
@mr.kdrama2.o53
@mr.kdrama2.o53 - 06.09.2022 13:56

sir notes or ppt dona interiview keliye read karna hai apke easy hai notes plz

Ответить
@MelodyWorldddzz
@MelodyWorldddzz - 30.07.2022 08:34

You are amazing sir ❤️

Ответить
@kashifsiddiqui4042
@kashifsiddiqui4042 - 16.06.2022 14:51

Very well explained! Thank you so much for making DSA this much easy!!

Ответить
@manojmani5452
@manojmani5452 - 16.06.2022 06:44

Nice explanation sir

Ответить
@poojithakumaran8946
@poojithakumaran8946 - 03.04.2022 19:31

@Dinesh Varyani why cant u discuss the time and space complexity for each operations insert,delete etc...

Ответить
@karentechnologies3990
@karentechnologies3990 - 06.03.2022 15:56

You can make the following changes in your code if you want to check if a given position is valid or not
private void insertAtPosition(int value, int position, SinglyLinkedList singlyLinkedList){

ListNode node = new ListNode(value);
if (position == 0 || position > singlyLinkedList.length()+1){
System.out.println("Error, Invalid Position");
return;
}
}

Ответить
@pushkarkumaryadav2570
@pushkarkumaryadav2570 - 08.10.2021 22:36

Sir Thank you very much for this but why there is so less likes ?

Ответить
@chinomsojohnson8746
@chinomsojohnson8746 - 19.09.2021 00:43

I just started learning DSA and I am curious on why your count starts from one and not zero. Any particular reason why?

Ответить
@dineshr4732
@dineshr4732 - 05.09.2021 19:09

Thanks a lot Dinesh Varyani. This has helped me a lot.

Ответить
@sambeetrath7328
@sambeetrath7328 - 03.08.2021 20:11

What if the given position is invalid? Should we write an if statement at the beginning of insert ()?

Ответить
@achiever27
@achiever27 - 10.05.2021 20:01

Amazing DSA playlist

Ответить
@afaqkhan2243
@afaqkhan2243 - 27.04.2021 14:13

Sir i need your mail ya number sir plz give me.

Ответить
@afaqkhan2243
@afaqkhan2243 - 27.04.2021 14:12

Very nice sir

Ответить
@raz0229
@raz0229 - 18.03.2021 18:47

Never knew light IDE themes could be so catchy :D

Ответить
@nirmesh44
@nirmesh44 - 06.02.2021 14:08

i am watching all your videos. very nicely explained👌

Ответить
@sanjushekhawat6446
@sanjushekhawat6446 - 02.02.2021 17:00

Thanks sir

Ответить