Learn Linked Lists in 13 minutes 🔗

Sdílet
Vložit
  • čas přidán 18. 04. 2021
  • LinkedList data structures and algorithms tutorial example explained
    #linkedlist #linkedlists #tutorial
    // *******************************************************
    // LinkedList = Nodes are in 2 parts (data + address)
    // Nodes are in non-consecutive memory locations
    // Elements are linked using pointers
    // advantages?
    // 1. Dynamic Data Structure (allocates needed memory while running)
    // 2. Insertion and Deletion of Nodes is easy. O(1)
    // 3. No/Low memory waste
    // disadvantages?
    // 1. Greater memory usage (additional pointer)
    // 2. No random access of elements (no index [i])
    // 3. Accessing/searching elements is more time consuming. O(n)
    // uses?
    // 1. implement Stacks/Queues
    // 2. GPS navigation
    // 3. music playlist
    // *******************************************************
  • Věda a technologie

Komentáře • 188

  • @BroCodez
    @BroCodez  Před 3 lety +158

    TL;DR
    small data set: LinkedList = BAD
    large data set + lots of searching: LinkedList = BAD
    large data set + lots of inserting/deleting: LinkedList = GOOD
    import java.util.LinkedList;
    public class Main{

    public static void main(String[] args) {
    // *******************************************************

    // LinkedList = Nodes are in 2 parts (data + address)
    // Nodes are in non-consecutive memory locations
    // Elements are linked using pointers

    // advantages?
    // 1. Dynamic Data Structure (allocates needed memory while running)
    // 2. Insertion and Deletion of Nodes is easy. O(1)
    // 3. No/Low memory waste

    // disadvantages?
    // 1. Greater memory usage (additional pointer)
    // 2. No random access of elements (no index [i])
    // 3. Accessing/searching elements is more time consuming. O(n)

    // uses?
    // 1. implement Stacks/Queues
    // 2. GPS navigation
    // 3. music playlist
    //

    // *******************************************************
    LinkedList linkedList = new LinkedList();
    /*
    // LinkedList as a Stack
    linkedList.push("A");
    linkedList.push("B");
    linkedList.push("C");
    linkedList.push("D");
    linkedList.push("F");
    linkedList.pop();
    */
    // LinkedList as a Queue
    linkedList.offer("A");
    linkedList.offer("B");
    linkedList.offer("C");
    linkedList.offer("D");
    linkedList.offer("F");
    //linkedList.poll();

    //linkedList.add(4, "E");
    //linkedList.remove("E");
    //System.out.println(linkedList.indexOf("F"));


    //System.out.println(linkedList.peekFirst());
    //System.out.println(linkedList.peekLast());
    //linkedList.addFirst("0");
    //linkedList.addLast("G");
    //String first = linkedList.removeFirst();
    //String last = linkedList.removeLast();

    System.out.println(linkedList);

    }
    }

  • @geeknet07
    @geeknet07 Před 3 lety +100

    This channel doesn't have normal content.
    rather masterpieces

  • @leihan2670
    @leihan2670 Před 8 měsíci +27

    I just love the way you teach, straightforward, easy, and clear。 Lucky to have you in this world

  • @deafprophets9009
    @deafprophets9009 Před 7 měsíci +1

    That was the most simple straightforward no bs explanation for a data structure ever. You make DS&A look approachable!! Thanks for the content 🙏

  • @jaimuelsilva5016
    @jaimuelsilva5016 Před 3 lety +134

    Your videos teach me more than my professor.

    • @siphiweclintonmthebule6474
      @siphiweclintonmthebule6474 Před 2 lety +7

      More knowledge in a shorter period of time

    • @marxLz
      @marxLz Před 2 lety +1

      they're really practical

    • @Ryder-gd9tl
      @Ryder-gd9tl Před rokem

      seriously same lol, learned in 10 min what took my professor a 90min lecture

    • @amaanshaikh6868
      @amaanshaikh6868 Před rokem

      True😹

    • @joelikespotatoes8321
      @joelikespotatoes8321 Před rokem +1

      Same here, I wish I could pinpoint why this is so common, honestly it's concerning that "professionals" are getting dunked on by youtube.

  • @adityajain7486
    @adityajain7486 Před 3 lety +18

    You are a god of programming, Thank you for making my life easier. you are way more better than my stupid college teachers.

  • @marklaw3938
    @marklaw3938 Před 3 lety +37

    What a godsend of a video. I'm crrently doing online CS 1103 course and literally the topic for this week is about linked lists. Thank you for this video. Your videos have truly helpful in my studies thus far.

    • @BroCodez
      @BroCodez  Před 3 lety +7

      Awesome! Looks like I made this video just in time!
      I'm glad they're helping!

  • @DeveloperLewis
    @DeveloperLewis Před 2 měsíci +1

    Awesome, simple explanation covering LinkedList thanks

  • @hillcountrydev
    @hillcountrydev Před rokem

    Just found your channel. One of my fav dev channels on YT. Proud to call myself a bro 🤙🏼

  • @MrSlinky
    @MrSlinky Před 2 lety +1

    OMG you just helped me to understand in laymen's terms what my professor and multiple other youtubers couldn't

  • @burn-e-e6980
    @burn-e-e6980 Před 9 měsíci +1

    Amazing teaching way really like it

  • @anywaylose3999
    @anywaylose3999 Před 11 měsíci

    Great video, simple and understandable

  • @amadujalloh4700
    @amadujalloh4700 Před 3 lety +13

    My bro who code;
    You are the best man
    I am a CS student in The Gambia 🇬🇲!
    This channel is awesome

  • @longfeili254
    @longfeili254 Před 5 měsíci

    Awesome teaching guide not only teach easily to understand but coding clearly. Thanks greatly!

  • @davidjunior390
    @davidjunior390 Před 9 měsíci +1

    This is the only explanation I've been able to comprehend. Thank you

  • @danielmilewski7659
    @danielmilewski7659 Před rokem

    Awesome video, again Gold standard teaching methods!

  • @santiagoaristi216
    @santiagoaristi216 Před 2 lety +1

    Idk there's really nobody that explains anything like our fellow "Bro". Completely, underrated and undervalued! Thank you for what you do video after video. Btw we need more input more input lol

  • @Amir_Plays_non_stop
    @Amir_Plays_non_stop Před 3 lety

    Hahahaha never stop surprising me! Each video is literally blowing my mind, what a way of explaining! Keep it up!

  • @fadethecreator
    @fadethecreator Před rokem +3

    Hey bro, could you please do one on singlys like using the linked list class. This is eternally helpful, though I’m struggling to find tutorials on youtube that cover anything like the ListNode class, so if you could that would be amazing because your videos are the best!

  • @shivamjha5962
    @shivamjha5962 Před 2 lety +4

    A docx/pdf file of this courses source codes and notes will be really helpful...thanks for keeping this course free really means a lot!!

  • @visna3319
    @visna3319 Před rokem

    your videos make me LOOOVE coding!! never thought I would say that so THANK YOU 🙏🙏

  • @brandonkruger9040
    @brandonkruger9040 Před 3 lety

    We on a roll tonight! Thanks for sharing bro.

  • @iRandroid
    @iRandroid Před 3 lety +1

    Great as always

  • @musicspirit7015
    @musicspirit7015 Před 10 měsíci

    Thank you very muchh! I've been struggling alot about linklist address pointers and arrays for so long , but i watched just 10 mins of yours and I now understand everything! Thanks again brooo T-T

  • @muhammed5667
    @muhammed5667 Před rokem

    Thanks for the concise explanation, I feel confident for my quiz!

  • @sigmaxricky6411
    @sigmaxricky6411 Před 3 lety

    gave a like before watching coz i know it will be amazing as always

  • @theuberman7170
    @theuberman7170 Před 3 lety +4

    OMG right on time!! Are you reading our minds?

  • @Wonder_Chariot
    @Wonder_Chariot Před 21 dnem

    I absolutely love the way bro introduces himself. i love you bro

  • @user-pi1nr5uf7w
    @user-pi1nr5uf7w Před 3 lety

    Holy shit, that’s incredible man. I really like your tutorials

  • @GrowthPulse509
    @GrowthPulse509 Před 3 lety +1

    Pretty helpful thank you so much sir

  • @RyanHurku
    @RyanHurku Před 2 lety

    it is unfair that this video only has 554 likes at the time of my viewing , you explained in under 15 minutes , what took my professor 3 hours and 2 slideshows

  • @wolanus
    @wolanus Před 3 lety

    Great video, thanks!

  • @mohdsaleh3516
    @mohdsaleh3516 Před 3 lety

    Thx Bro for all your videos, i love them all, plz finish as much as u canbon data structure, then plz java design patterns, generics, functional prog. in java (lambda expressions), and parallel programing. Anything you like...

  • @aymanmouhcine5749
    @aymanmouhcine5749 Před rokem

    Amazing explanation

  • @dashunderscore7470
    @dashunderscore7470 Před rokem

    thank you bro , loved it , its so detailed and wasy to understand

  • @poles1c
    @poles1c Před 5 měsíci

    This was extremely helpful, thank you!

  • @DevJoeOficial
    @DevJoeOficial Před 10 měsíci

    Awesome content, tks a lot!!!

  • @changyou4454
    @changyou4454 Před 3 lety +2

    🚀100K+ soon! Thanks, Bro you're our hero!

  • @rahulmandal1380
    @rahulmandal1380 Před 3 lety +6

    Hlw Bro Code!
    Keep updating this playlist at regular intervals.
    The way you explain is Awesome..
    😊😊😊😊😀😀😀

    • @BroCodez
      @BroCodez  Před 3 lety +9

      Thanks! I will!
      Weekly is a good interval, these are tough topics to discuss 😅

  • @ottttoooo
    @ottttoooo Před 3 lety +13

    Hey Bro, I just finished the java for beginners playlist, it was very well done btw! Prior to that, I had absolutely zero experience in coding, and that was a great start.
    What would you recommend for me next? maybe specific projects I could work on to improve my skills? because I feel kinda lost now :D
    Thank you!

    • @B3Band
      @B3Band Před rokem

      I've been solving problems on leetcode and hackerrank
      That's how I ended up here, because I've never heard of a linked list despite following Bro Code for like 3 months now

  • @Lalogum
    @Lalogum Před měsícem

    better than all my prof. much love

  • @thaungthanhan5928
    @thaungthanhan5928 Před rokem

    Really awesome.

  • @RAHULSINGH-sn2ol
    @RAHULSINGH-sn2ol Před 3 lety

    Much better than my professor,
    Keep it up Bro
    #brocode👍

  • @stevend1394
    @stevend1394 Před 6 měsíci

    I'm here again to refresh my knowledge.

  • @abdullahsaid4765
    @abdullahsaid4765 Před 3 lety +1

    my bro is here thank you :)+)

  • @DanishFarhan-wg3xz
    @DanishFarhan-wg3xz Před měsícem

    so many informations in one video :>. thanks

  • @alexreznitsky6338
    @alexreznitsky6338 Před rokem

    You are my real JavaBro =) thanks a lot

  • @leruleru8723
    @leruleru8723 Před rokem

    Thank you so much bro💫life saving💓

  • @azamatey
    @azamatey Před 2 lety

    I've become BROOOOOO!!! Thanks broo, you are the best!!!

  • @lskdjfsldfjdslkfj
    @lskdjfsldfjdslkfj Před 6 měsíci

    very very helpful thank you!

  • @felixnyamongo
    @felixnyamongo Před rokem

    Awesome Bro

  • @murilosilvestre7736
    @murilosilvestre7736 Před 3 lety

    great, thank you, bro!

  • @mindlessmeat4055
    @mindlessmeat4055 Před rokem

    Love your videos. They are so good. Did you add and remove an element but didn't show add working?

  • @amitaimyers9342
    @amitaimyers9342 Před 2 lety +1

    Thank you Bro!

  • @neil_armweak
    @neil_armweak Před 3 lety +2

    Fantastic content!

  • @baubaudinamo
    @baubaudinamo Před 3 lety

    Awesome.

  • @victorrezende6002
    @victorrezende6002 Před 9 měsíci +1

    Nice class

  • @meeknkosi
    @meeknkosi Před 3 lety

    am glad to be your bro !

  • @soicooc3500
    @soicooc3500 Před 5 měsíci

    thanks , very clear

  • @TheEvertonDias
    @TheEvertonDias Před rokem

    Thanks, Bro!

  • @DWEthiopia
    @DWEthiopia Před 2 lety

    Since the LinkedList can be used as a Stack and a queue, is there a really a need to use the Stack or Queue class in Java?

  • @letampatrickbienwi4610
    @letampatrickbienwi4610 Před 4 měsíci

    Legend!

  • @syedmaaz2374
    @syedmaaz2374 Před 2 lety +1

    I buy 2500 rupees course to understand DSA but now i realise my money is waste .Because you more better than course

  • @abdurequiem4919
    @abdurequiem4919 Před 2 lety

    A video on how to reverse a Linked List please. Btw love your videos 🙌

  • @drunkpancakes6277
    @drunkpancakes6277 Před 3 lety

    Can you do some object oriented code for Java. Love your channel and need it to not fail my class. Threads and recursive methods and stuff 🥵🙈??

  • @adriano7710
    @adriano7710 Před 3 lety +2

    Bro, just what I nedded for a project!!!!
    You are awesome sir.

    • @BroCodez
      @BroCodez  Před 3 lety +2

      Nice! I made it just in time then!

    • @soumichandra8927
      @soumichandra8927 Před 3 lety

      @@BroCodez Bro, I want to contact you. How to do so?

  • @sandakelumhalkewela7854

    Thanks brocode . this helped me a lot

  • @codewithsmoil4098
    @codewithsmoil4098 Před 3 lety

    You are doing good...
    I'm your new subscriber ^_^

  • @solonton6341
    @solonton6341 Před 2 lety +2

    Thanks for this great video. Can you implement the linked list from scratch?

  • @houssseinzekra
    @houssseinzekra Před rokem

    better from the best coder i know . would you please consider doing it in pytohn

  • @33v4.
    @33v4. Před 3 lety

    super helpful thanks a lot! what about these D&D generators

  • @ahmadyaseen2617
    @ahmadyaseen2617 Před 3 lety

    Please dont stop making videos although you are getting less views and likes we know your videos are worthy and very helpfull for us

  • @oni1ecram123
    @oni1ecram123 Před 3 lety +5

    "666 Crime circle "....that adress sounds so dark...😅😅

  • @user-hq9rs3tt9i
    @user-hq9rs3tt9i Před 2 měsíci

    Perfect

  • @creampielover69
    @creampielover69 Před 3 lety

    So linked lists work sequentially, like memory cells in the RAM right?

  • @achillesa5894
    @achillesa5894 Před 11 měsíci

    The first 5 minutes of this explained it better than a year of university

    • @j12325
      @j12325 Před 10 měsíci

      Fun fact: he learned from your University

  • @joelmalepe4862
    @joelmalepe4862 Před 2 lety

    Thanks Bro, I always checkout your videos to finally understand these kind of topics. I would really love to meet the person who has hit the dislike button.

  • @ardacakr6464
    @ardacakr6464 Před 3 lety +1

    thank you.

  • @cipherguard
    @cipherguard Před rokem

    Awsome

  • @mortezaaslami2572
    @mortezaaslami2572 Před 11 měsíci

    Thanks mate

  • @arkamukhopadhyay2177
    @arkamukhopadhyay2177 Před 3 lety

    hey, would linkedList.add(0,"something") behave same as linkedList.addFirst("something") ?

  • @Melvishify
    @Melvishify Před 3 lety

    Ty bro

  • @resilientbloke
    @resilientbloke Před rokem

    thanks bro

  • @lomzoetc1125
    @lomzoetc1125 Před 2 lety

    Thanks bro

  • @rajitgupta1140
    @rajitgupta1140 Před 3 lety +2

    how can we create singly linked lists?

  • @percivalgebashe4376
    @percivalgebashe4376 Před rokem

    Nice

  • @elsonbejleri4785
    @elsonbejleri4785 Před 2 měsíci

    I demand to see what's behind those D&D files!

  • @gameGXT
    @gameGXT Před 2 lety

    super

  • @slavkomag
    @slavkomag Před 2 lety +3

    Hey, Bro! Could you (or any other of you folks grasping big Oh notation) explain, why inserting and deleting is O(1) and not O(n)? Would'nt the algorithm need to traverse the nodes to find the appropriate place to change the addresses for the newly created element?

    • @NikolasToCore
      @NikolasToCore Před rokem +1

      I'm still learning, but i've also been thinking about this, and i think you're right. The time complexity of O(1) for deleting and adding data in a linked list is only at the beginning and end of the list, because there is no need to shift elements like in an array. However, the time complexity becomes linear, O(n), if the element is somewhere "inside" the list. Because linked lists do not have indexes (that's the whole point), the element you want to delete or change within a list has to be found first, and as i understand, it is done by traversing the list. You have to go through all the elements of the list until the end or until a matching element is found.
      So the main advantage of linked lists over arrays is that they can shrink and grow faster if elements are added or deleted from the beginning or end of a list.

    • @Iamfafafel
      @Iamfafafel Před rokem

      @@NikolasToCorealso learning but I think deleting at end is O(n) not O(1) since you need to transverse through the whole thing to know where the new end is. Deleting at the beginning is definitely O(1) though

  • @angelenriquerodriguezmoral7397

    thankiuuu

  • @yehannk448
    @yehannk448 Před 3 lety +1

    Bro are you thinking of doing a php series ?

  • @nightcrawler2126
    @nightcrawler2126 Před rokem

    My exam's tomorrow 💀thank you man

  • @oussemaelmzergui7055
    @oussemaelmzergui7055 Před 9 měsíci

    👏👏👏

  • @RakXm09
    @RakXm09 Před 3 lety

    hello, I have a question, how can I know or see the address of each nodes? thank you

  • @MrLoser-ks2xn
    @MrLoser-ks2xn Před rokem

    Thanks

  • @VinothKumar-ut4rj
    @VinothKumar-ut4rj Před 8 měsíci

    bro please make a video about operations and all operators applicable with 'objects' in java.

  • @minodasasvindi3807
    @minodasasvindi3807 Před 3 měsíci

    thank youu

  • @longbeachgriffy4548
    @longbeachgriffy4548 Před 4 měsíci

    Self learner here I do driver development for fun and I could vouch u are him

  • @user-zn3qw8qd4v
    @user-zn3qw8qd4v Před měsícem

    random comment to help the algorithm :)

  • @rohitgajula
    @rohitgajula Před 3 lety

    Explain about pyaudio pygame librarys Bro..