Lec-77: Insertion at the beginning of Linked list | Python 🐍 for Beginners
Автор: Gate Smashers
Загружено: 2024-01-02
Просмотров: 39771
In this video, Varun sir will be 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. He will discuss about insertion at the beginning of Linked List. #python #pythonprogramming.
--------------------------------------------------------------------------------------------------------------------------------------
Timestamps:
00:00 – Insertion at beginning of linked list
01:42 – Pseudo code
--------------------------------------------------------------------------------------------------------------------------------------
👉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) Complete...
► Theory of Computation
• TOC(Theory of Computation)
►Artificial Intelligence:
• Artificial Intelligence (Complete Playlist)
►Computer Architecture:
• Computer Organization and Architecture (Co...
►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 (Complete Course)
►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 Syllabus)
► 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: gatesmashers2018@gmail.com
#python #pythonprogramming
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: