Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Lec-80: Insertion at the end of Linked list | Python 🐍 for Beginners
Play lesson

Python for Beginners - Lec-80: Insertion at the end of Linked list | Python 🐍 for Beginners

5.0 (0)
7 learners

What you'll learn

This course includes

  • 10.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

A linked list is a linear data structure where each element is a separate object. The elements are not stored in contiguous memory locations, but rather as separate nodes. Each node contains a data field and a reference (or link) to the next node in the list. To insert an element at the end of a linked list, you need to create a new node with the data you want to insert and then link it to the last node in the list. #python #pythonprogramming -------------------------------------------------------------------------------------------------------------------------------------- Timestamps: 00:00 – Insertion at end 02:10 – 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 with data 50 at the end new_node = Node(50) head=node1 current = head while current.next is not None: current = current.next current.next = new_node πŸ”Ή Gate Smashers Shorts: Watch quick concepts & short videos here: https://www.youtube.com/@GateSmashersShorts πŸ”Ή Subscribe for more shorts and motivational content: https://www.youtube.com/@varunainashots β–Ί Python For Beginners (Complete Playlist): https://www.youtube.com/playlist?list=PLxCzCOWd7aiEb4apyN1Y8mD-QuUTr3SPQ Other Subject-wise Playlist Links: -------------------------------------------------------------------------------------------------------------------------------------- β–ΊComputer Networks : https://www.youtube.com/playlist?list=PLxCzCOWd7aiGFBD2-2joCpWOLUrDLvVV_ β–ΊDesign and Analysis of algorithms (DAA): https://www.youtube.com/playlist?list=PLxCzCOWd7aiHcmS4i14bI0VrMbZTUvlTa β–ΊDatabase Management System: https://www.youtube.com/playlist?list=PLxCzCOWd7aiFAN6I8CuViBuCdJgiOkT2Y β–Ί Theory of Computation https://www.youtube.com/playlist?list=PLxCzCOWd7aiFM9Lj5G9G_76adtyb4ef7i β–ΊArtificial Intelligence: https://www.youtube.com/playlist?list=PLxCzCOWd7aiHGhOHV-nwb0HR5US5GFKFI β–ΊComputer Architecture: https://www.youtube.com/playlist?list=PLxCzCOWd7aiHMonh3G6QNKq53C6oNXGrX β–ΊOperating System: https://www.youtube.com/playlist?list=PLxCzCOWd7aiGz9donHRrE9I3Mwn6XdP8p β–ΊStructured Query Language (SQL): https://www.youtube.com/playlist?list=PLxCzCOWd7aiHqU4HKL7-SITyuSIcD93id β–ΊDiscrete Mathematics: https://www.youtube.com/playlist?list=PLxCzCOWd7aiH2wwES9vPWsEL6ipTaUSl3 β–ΊCompiler Design: https://www.youtube.com/playlist?list=PLxCzCOWd7aiEKtKSIHYusizkESC42diyc β–ΊNumber System: https://www.youtube.com/playlist?list=PLxCzCOWd7aiFOet6KEEqDff1aXEGLdUzn β–ΊCloud Computing & BIG Data: https://www.youtube.com/playlist?list=PLxCzCOWd7aiHRHVUtR-O52MsrdUSrzuy4 β–ΊSoftware Engineering: https://www.youtube.com/playlist?list=PLxCzCOWd7aiEed7SKZBnC6ypFDWYLRvB2 β–ΊData Structure: https://www.youtube.com/playlist?list=PLxCzCOWd7aiEwaANNt3OqJPVIxwp2ebiT β–ΊGraph Theory: https://www.youtube.com/playlist?list=PLxCzCOWd7aiG0M5FqjyoqB20Edk0tyzVt β–ΊProgramming in C: https://www.youtube.com/playlist?list=PLxCzCOWd7aiGmiGl_DOuRMJYG8tOVuapB β–ΊDigital Logic: https://www.youtube.com/playlist?list=PLxCzCOWd7aiGmXg4NoX6R31AsC5LeCPHe β–Ί Class XI Computer Science(Full Syllabus) https://www.youtube.com/playlist?list=PLxCzCOWd7aiGPUtEXMqeQcHYH7ACCJvz7 β–Ί Microprocessor Playlist: https://www.youtube.com/playlist?list=PLxCzCOWd7aiHL7mF_dRsj4Q9x1NNaZqkh --------------------------------------------------------------------------------------------------------------------------------------- Our social media Links: β–Ί Subscribe to us on YouTube: https://www.youtube.com/gatesmashers β–ΊSubscribe to our new channel: https://www.youtube.com/@varunainashots β–Ί Like our page on Facebook: https://www.facebook.com/gatesmashers β–Ί Follow us on Instagram: https://www.instagram.com/gate.smashers β–Ί Follow us on Instagram: https://www.instagram.com/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

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere