Delete The First Node in Linked List | Delete At the Beginning | Python Program

preview_player
Показать описание
In this Python Programming video tutorial you will learn about how to implement Linked List data structure in python in detail.

Data structure is a way of storing and organising the data so that it can be accessed effectively.
Linked List is a linear data structure made up of chain of nodes in which each node contains a data field and link or reference.

To implement Singly Linked List we are using class concepts here.

Program:
def delete_begin(self):
print("Linked List is empty can't delete!")
else:



#DataStructures #PythonPrograms #LinkedList

For more free tutorials on computer programming
Рекомендации по теме
Комментарии
Автор

It is the best channel out there for explaining python data structures, thanks a lot for making these videos.

prionto
Автор

i love your videos. It makes me learn the logic beyond the code. As a beginner this is really helpful.

reallyreally
Автор

The way you explain everything is amazing mam. It would be nice if you make the videos as short as possible.

pprabhakar
Автор

osm osm osm nice explanation thank you very much

ulqwwxw
Автор

Keyboard sound is satisfying 😊
And Information is helpful 👍🏻

omkarsutar
Автор

Thank you so much! you are the best teacher.

pini
Автор

I started watching your videos because duration of your video is very less so i dont get bored.
Your theory part is okay but when it comes to programming you lack something. Thank you

TheZenithSaga
Автор

I support to u channel mam, keep rocking and try to complete ds as soon as possible.

pavankumar
Автор

mam, what do you think about this code?
def remove_beginning(self):
n=self.head
if self.head is None:
print("the linked list is empty")
else:
self.head = n.ref

aliffnabil
Автор

can you explain y n=self.head n=n.ref is not working

seemanazeer
Автор

please upload full playlist of DsA with python or else bring a full structured course, I'm ready to purchase

harishrajwani
Автор

Hi.
If I take n = self.head, and do further operations with n, it doesn't work for deleting first node method i.e delete_begin() in your case.
Why is it necessary to use self.head everywhere instead of n. Whereas, n worked perfectly in other functions. If you could kindly explain the logic.

hassaanfayyaz
Автор

Plzz make a video on stacks and queues...

zerday
Автор

What modification we need to do while delelting element from beginning when there is only one element in linked list?

naveenjha
Автор

If we just pointing head to the next node then how can we release the memory of the first deleted node?

parvejinamdar
Автор

Will this method completely erase that particular node( beginning node ) from the memory ?
If not what will be the method ?

vimalanss
Автор

Hi! Do you also have a video series based on Trees? The videos on LL are really good! Moreover, why is it " if self.head is None" and not "if self.head.data is None" when you're trying to find if the LL is empty or not?

tapstothebeat
Автор

when i try to insert an element in the middle and then try to delete the front element it shows that the list is empty. can you please tell me why? ;(

ankitasaha
Автор

Mam plzzz help me how can I solve this in python
#.#.#.#.#
#.#...#.#

#.#...#.#
#.#.#.#.#

If input 2
And also modify it for user input..plzzz mam

ajaykumarnanduri
Автор

This Code will not work if there is one node in LinkedList. Can you provide the updated code for One Node..
I tried but it is not working. Plz can you tell me the solution.

Code:

def delete_beginning(self):
""" This is the first Node as i assigned the head value to n(First Node)"""
n = self.head
if self.head is None:
print('LinkedList is Empty Already !!!')
elif n.data is not None and n.ref is None:
n.data = None
self.head = None
else:
"""Then i have assigned the reference of first first Node to head"""
self.head = n.ref

aibasics