Linked Lists - Singly & Doubly Linked - DSA Course in Python Lecture 3

Поділитися
Вставка
  • Опубліковано 5 лют 2025
  • Code solutions in Python, Java, C++ and JS can be found at my GitHub repository here: github.com/gah...
    The Python Colab notebook can be found at this link: colab.research...
    Master Data Structures & Algorithms for FREE at AlgoMap.io/
    Complete DSA Pathway Zero to Hero: • Data Structures & Algo...
    Please check my playlists for free DSA problem solutions:
    • Fundamental DSA Theory
    • Array & String Questions
    • 2 Pointers Questions
    • Sliding Window Questions
    • Binary Search Questions
    • Stack Questions
    • Linked List Questions
    • Tree Questions
    • Heap Questions
    • Recursive Backtracking...
    • Graph Questions
    • Dynamic Programming (D...
    My Data Science & ML UA-cam Playlist: • Greg's Path to Become ...
    Learn Python and Data Science FASTER at mlnow.ai :)
    Support the content: / @greghogg
    Follow me on Instagram: / greghogg5
    Connect with me on LinkedIn: / greghogg
    Follow me on TikTok: / greghogg5
    Coursera Plus: imp.i384100.ne...
    My Favorite Courses:
    Data Structures & Algorithms:
    UCalifornia San Diego DSA: imp.i384100.ne...
    Stanford Algorithms: imp.i384100.ne...
    Python Data Structures: imp.i384100.ne...
    Meta Coding Interview Prep: imp.i384100.ne...
    Python:
    UMichigan Python for Everybody: imp.i384100.ne...
    Python Mastery from MLNOW.ai: mlnow.ai/cours...
    Google IT Automation w/ Python: imp.i384100.ne...
    Web Dev / Full Stack:
    Meta Front-End Developer: imp.i384100.ne...
    IBM Full Stack Developer: imp.i384100.ne...
    Meta Back-End Developer: imp.i384100.ne...
    John Hopkins HTML, CSS & JS: imp.i384100.ne...
    IBM DevOps: imp.i384100.ne...
    Cloud Development:
    AWS Fundamentals: imp.i384100.ne...
    GCP Cloud Engineer: imp.i384100.ne...
    Microsoft Azure Fundamentals: imp.i384100.ne...
    Game Development:
    Michigan State Unity Development: imp.i384100.ne...
    UColorado C++ for Unreal Engine: www.coursera.o...
    SQL & Data Science:
    SQL by MLNOW.ai: mlnow.ai/cours...
    Python for Data Science by MLNOW.ai: mlnow.ai/cours...
    Google Data Analytics: imp.i384100.ne...
    IBM Data Science: imp.i384100.ne...
    IBM Data Engineer: imp.i384100.ne...
    Machine Learning & AI:
    ML Mastery at MLNOW.ai: mlnow.ai/cours...
    ML w/ Andrew Ng: www.coursera.o...
    Deep Learning w/ Andrew Ng: imp.i384100.ne...

КОМЕНТАРІ • 46

  • @GregHogg
    @GregHogg  6 місяців тому +6

    Master Data Structures & Algorithms For FREE at AlgoMap.io!

  • @ahmedzz4754
    @ahmedzz4754 7 місяців тому +30

    I bet my life that this would be the most informative and non repetitive DSA course on UA-cam

    • @GregHogg
      @GregHogg  7 місяців тому +2

      Haha thank you! It seems to be going well so far

  • @hema4k358
    @hema4k358 6 місяців тому +5

    I love the fast paced explanation, it's non repetitive flow of new information, you definitely my new favorite gregg 😁

  • @muhammadrao1246
    @muhammadrao1246 6 місяців тому +9

    Back then i have done data structures in c++. In python it is lot more easier to understand and implement 😂. Thanks to you! ❤

    • @GregHogg
      @GregHogg  6 місяців тому +3

      Yes it definitely is haha

  • @spidey2468
    @spidey2468 7 місяців тому +8

    I'm currently busy with personal stuff but Pls keep it up definitely I'm going to brush up your series for DSA prep ❤

    • @GregHogg
      @GregHogg  7 місяців тому +2

      Awesome

    • @Bigcuh47
      @Bigcuh47 10 днів тому

      @@GregHogg skibidi GregHogg

  • @Youssef-o9y1r
    @Youssef-o9y1r 4 місяці тому

    I understood the code but didn't understand the concept prior to this video, now I do. Tysm

  • @SravanJangam
    @SravanJangam 14 днів тому

    Superb explanation....👏👏

  • @gamalserag2045
    @gamalserag2045 7 місяців тому +1

    That's Awesome man, Thank you for such high-quality content.

    • @GregHogg
      @GregHogg  7 місяців тому +2

      You're very welcome!

  • @ahmedshehata7783
    @ahmedshehata7783 7 місяців тому +1

    Great Explanation
    Keep up the good work 👏

    • @GregHogg
      @GregHogg  7 місяців тому +1

      Thank you!!

  • @bababooey4772
    @bababooey4772 Місяць тому +1

    this is exactly what i needed , thanks a lot

  • @MaharsheeKShah
    @MaharsheeKShah 7 місяців тому +1

    Great video. I understand it now 100%

    • @GregHogg
      @GregHogg  7 місяців тому

      Glad to hear it!

  • @khorshedkhorshed9137
    @khorshedkhorshed9137 7 місяців тому +2

    Thanks for your tutorial you are great ❤

    • @GregHogg
      @GregHogg  7 місяців тому

      Thanks so much!!!

  • @Andrew_N_G
    @Andrew_N_G 6 місяців тому +4

    Hey dude you have great teaching skills.but i have a question will you cover all the topics of dsa in this coures?

  • @YollarSenin
    @YollarSenin 17 днів тому

    Removing an arbitrary node from single or double linked list should be O(n) 8:27

  • @devgiri4730
    @devgiri4730 3 місяці тому

    hey Greg best explanation i have got so far . I have a question , Is this fundamental DSA theory playlist is completed for learning complete data structures?

  • @Said-uz4wz
    @Said-uz4wz 2 місяці тому +3

    I have a question, in the insert_at_the beginning function for the doubly linked list, why are you passing the tail, if you just return it and do not use it in the function, can you not skip it?

    • @salin5273
      @salin5273 2 місяці тому

      I had the same question. If u remove tail nothing will change. It’s useless. Maybe this code structure is needed in any leetcode problems, I don’t know…

    • @gabrielassuncao1319
      @gabrielassuncao1319 Місяць тому

      kind of useless

  • @starboy9562
    @starboy9562 6 місяців тому

    Thank you very much! Very informative

  • @richardpro8927
    @richardpro8927 7 місяців тому +1

    Awesome ❤

  • @ProCodesMedia
    @ProCodesMedia 3 місяці тому

    Great ❤

  • @AlborzBorzoo
    @AlborzBorzoo 7 місяців тому +1

    thanks for such clear explanation
    but what i fail to understand is that why is knowing about such things needed?
    seeing as they arent directly implemented in any programming language, what will they do that something like an array cannot accomplish? and why do they matter?

    • @anaranyosarkar2695
      @anaranyosarkar2695 6 місяців тому +2

      That's a very pertinent question, and it's something that even I have spent time thinking about.
      To be exact, the difference comes in the storage and access of data. For example, take insertion. An array takes O(n) complexity for insertion whereas a LinkedList takes O(1). This doesn't make a difference when the lengths are small, but for bigger input sizes, it has a significant difference in processing time which might make a certain algorithm much faster or slower depending on which data structure you are using. Plus if you're into solving problems on platforms like LeetCode or CodeForces, TLEs (Time Limit Exceeds) are exceedingly common. Those can be avoided by using appropriate data structures for appropriate purposes.
      I hope that answers your question!

  • @physicsfaith
    @physicsfaith 6 місяців тому

    Learning!

  • @verlder
    @verlder 3 місяці тому

    thanks

  • @helloworldcsofficial
    @helloworldcsofficial 5 місяців тому

    Thanks!

  • @dae9944
    @dae9944 19 днів тому

    curr is a pointer. if we print(curr) I assumed that it would print the address/reference to the node curr is pointing at. how does it print the value of the current node it is pointing at without explicitly writing print(curr.val) ?

    • @Lallu-gv9rs
      @Lallu-gv9rs 16 днів тому

      Hey I tried running by removing the .val and still it's working. I think the function of these Head, A , B ,C is to just point to each other by using .next like curr.next-> Head.next-> A and store the values in them. They are basically kind of objects where the class's return value is the val itself.

  • @sunbhattacharjee
    @sunbhattacharjee 9 днів тому

    Your voice is very similar to Shroud.

  • @rydmerlin
    @rydmerlin 5 місяців тому

    Why does insert_at_beginning need to take tail when all it does is return it.

  • @SemesterAtSeaHopeful
    @SemesterAtSeaHopeful 5 місяців тому

    Why do nodes start at 1 but lists start at 0?

    • @gauravswami6213
      @gauravswami6213 3 місяці тому

      they don't the position we use in nodes is just for our understanding it isn't there actually

    • @JAVA_SCRIPT-j5j
      @JAVA_SCRIPT-j5j 3 місяці тому

      Node doesn't start at 1 we access every node by the pointer(which stores address) which is head in this video .
      Basically head it stores or points the address of the first node in linked list, for better understanding learn cpp there you can learn in depth

  • @AlborzBorzoo
    @AlborzBorzoo 7 місяців тому +4

    thanks for such clear explanation
    but what i fail to understand is that why is knowing about such things needed?
    seeing as they arent directly implemented in any programming language, what will they do that something like an array cannot accomplish? and why do they matter?

    • @ahmedzz4754
      @ahmedzz4754 6 місяців тому +2

      @@AlborzBorzoo you may make a stack implementation with an array in some language , however if you tried to do the same thing with the queue it will work but it would be way slower as in the array in order to pop elements from the left all the other elements in the array would be shifted therefore taking O(n) complexity unlike the linked list implementation of the queue