Insertion at the beginning of Linked list | Python 🐍 for Beginners

Описание к видео Insertion at the beginning of Linked list | Python 🐍 for Beginners

00:00 – Insertion at beginning of linked list
01:42 – Pseudo code

In this video, discussing about how to add the element at beginning of linked list. This is to be explain with the help of source code and example. I hope this video is helpful to you.

👉Code for execution:
class Node:
def __init__(self, data):
self.data = data
self.next = None
Creating nodes
node1 = Node(10)
node2 = Node(20)
node3 = Node(30)
node4 = Node(40)
Connecting nodes
node1.next = node2
node2.next = node3
node3.next = node4
Adding a new node at the beginning
head=node1
new_node = Node(50)
new_node.next = head
head = new_node

👉Subscribe to our new channel:   / @varunainashots  

► Python For Beginners (Complete Playlist):
   • Python for Beginners  

Other Subject-wise Playlist Links:
--------------------------------------------------------------------------------------------------------------------------------------
►Computer Networks :
   • Computer Networks (Complete Playlist)  
►Design and Analysis of algorithms (DAA):
   • Design and Analysis of algorithms (DAA)  
►Database Management System:
   • DBMS (Database Management system) Com...  
► Theory of Computation
   • TOC(Theory of Computation)  
►Artificial Intelligence:
   • Artificial Intelligence (Complete Pla...  
►Computer Architecture:
   • Computer Organization and Architectur...  
►Operating System:
   • Operating System (Complete Playlist)  
►Structured Query Language (SQL):
   • Structured Query Language (SQL)  
►Discrete Mathematics:
   • Discrete Mathematics  
►Compiler Design:
   • Compiler Design (Complete Playlist)  
►Number System:
   • Number system  
►Cloud Computing & BIG Data:
   • Cloud Computing & BIG Data  
►Software Engineering:
   • Software Engineering  
►Data Structure:
   • Data Structure  
►Graph Theory:
   • Graph Theory  
►Programming in C:
   • C Programming  
►Digital Logic:
   • Digital Logic (Complete Playlist)  
► Class XI Computer Science(Full Syllabus)
   • CLASS-XI Computer Science (Full Sylla...  
► Microprocessor Playlist:
   • Microprocessor  

---------------------------------------------------------------------------------------------------------------------------------------
Our social media Links:
► Subscribe to us on YouTube:    / gatesmashers  
►Subscribe to our new channel:    / @varunainashots  
► Like our page on Facebook:   / gatesmashers  
► Follow us on Instagram:   / gate.smashers  
► Follow us on Instagram:   / varunainashots  
► Follow us on Telegram: https://t.me/gatesmashersofficial
► Follow us on Threads: https://www.threads.net/@gate.smashers
--------------------------------------------------------------------------------------------------------------------------------------
►For Any Query, Suggestion or notes contribution:
Email us at: [email protected]
#python #pythonprogramming

Комментарии

Информация по комментариям в разработке