8 Data Structures Every Programmer Should Know

Поділитися
Вставка
  • Опубліковано 30 вер 2024

КОМЕНТАРІ • 76

  • @michaelevan9184
    @michaelevan9184 7 днів тому +56

    Nice ... in my advanced graduate algorithms course now ... half-way to MS in CS at age 63. If you're in CS you will have to know all of those. Basic data structures. Great vids as always.

    • @pastafarian8410
      @pastafarian8410 7 днів тому +2

      Wow, great. It's commendable. Do you feel anything different than say you were studying in your 20s? Keep it up, sir.

    • @dalitsobanda7658
      @dalitsobanda7658 6 днів тому +2

      I am in my final year of my CS degree and I am going back to relearn a lot of basics because I half assed my way to where I am but I have grown to like the program and want to be competent.
      Tho don’t tell my boss

  • @MarkMcDaniel
    @MarkMcDaniel День тому +3

    Wow, I wasn't expecting the UA-cam algorithm to suggest I learn about data structures from a gas station clerk.

  • @One-qb6yv
    @One-qb6yv День тому +2

    I remember watching 1 or 2 of ur vids 8 months ago and i lost interesst and couldnt find the value.. now after hardcore 8 months of studying and practicing programing, system management and recently math.. i think this is the most valuable YT channel ive seen.. obv im not comparing it to freecode camp.. but obv ur not in the same nieche .. just went trough clearing the nonvaluable yt channels ive subscribed too and u are one of the fews i left there.. super cool, inspiring, relatable, and informative ofc!! :)

  • @willernst
    @willernst 3 дні тому +5

    My guy finished a day in the coal mines and came home to teach data structures! (can I get a link to that flannel? :D )

  • @epokaixyz
    @epokaixyz 6 днів тому +21

    Consider these actionable insights from the video:
    1. Learn about arrays to store collections of data of the same type.
    2. Explore linked lists when you need to efficiently insert or delete elements in a list.
    3. Understand stacks if your project requires managing data in a last-in-first-out manner.
    4. Utilize queues to process data in a first-in-first-out order, like managing tasks.
    5. Implement hash tables to store and retrieve data using key-value pairs for fast access.
    6. Master trees for representing hierarchical data and conducting efficient searches.
    7. Dive into heaps when you need to find the minimum or maximum value efficiently.
    8. Study graphs to represent and analyze relationships between objects or entities.

  • @LL43216
    @LL43216 День тому

    “Throw a hash map at it and hope for the best”
    I gave my friend that advice when we were both looking for a job our senior year of college.
    He told me a few weeks later that he was in an interview and had no idea what to do so he pulled out the hash map quote. The interviewer didn’t even bother having him implement it, they just said alright you sound like you know the approach we can continue

  • @IonutAlexandruPetcu
    @IonutAlexandruPetcu 19 годин тому

    ladies and gentlemen i think my brain committed suicide; but it's the exact information i need to solve a problem so it's well worth

  • @TheRealCompensator
    @TheRealCompensator 8 годин тому

    Excellent presentation. You have a new subscriber (me).

  • @kopilkaiser8991
    @kopilkaiser8991 День тому

    I do learn quite a lot from your great tutorials 📖💻 Thank you for providing such great content 😊

  • @tryCatchMeQWERTY
    @tryCatchMeQWERTY 6 днів тому +8

    It’s worth noting, that Python also allows storing different data types in a single list.
    In fact, this capability is common to all dynamically typed languages.

    • @soothsayer1
      @soothsayer1 6 днів тому +1

      And many statically typed languages which have a large runtime (like go for instance) have the same ability, in go you can just do this: var some [4]interface{}

    • @loo_9
      @loo_9 5 днів тому +1

      this is not actually true. python lists (and other containers) store pointers to any python type. to the user it seems as though a list can store multiple type simultaneously but in reality the type it stores is always a pointer to a python object.
      storing fixed size data is very important because you can easily calculate it’s memory location from the index and the list start. if you cannot guarantee the size it’s a linear search. for example see why you cannot just index into UTF-8 strings

    • @loo_9
      @loo_9 5 днів тому

      @@soothsayer1interfaces in the golang runtime are always pointers, for the same reason noted above. if you want an array with multiple types of elements, the way without using a pointer is a union type. the rust enum implementation is one such example

    • @simpletongeek
      @simpletongeek День тому

      Why does that sound like Unions in C?

    • @loo_9
      @loo_9 16 годин тому +1

      @@simpletongeek a union is a block of memory that can be interpreted as multiple types at the same time. so you can have a 4 byte int and a byte 4 array simultaneously. an interface is a pointer to a block of memory. the interface is also an agreement about the methods that can be run on it. this way you can call the same methods without knowing which type it is. but the important bit, is that an interface is only one of it’s types while a union is simultaneously all of it’s types

  • @jameelsaeed2780
    @jameelsaeed2780 2 дні тому

    I like this guy 😅
    I don’t want to escape Java

  • @MahmutAyabakan
    @MahmutAyabakan Хвилина тому

    Lewis Melissa Robinson Melissa Robinson Gary

  • @eaonflux1936
    @eaonflux1936 День тому

    where did you buy that keyboard?

  • @MrJloa
    @MrJloa 18 годин тому

    Fixed size arrays are boring

  • @tilted_realms
    @tilted_realms День тому

    Thanks dude! super helpful

  • @Dushyanth-l2w
    @Dushyanth-l2w 6 днів тому +3

    Hey Forest! I’ve been following your videos for a while now, and I really love your content. I would greatly appreciate it if you could make a video about Spring Boot.

  • @jazzochannel
    @jazzochannel 10 годин тому

    wtf am i watching

  • @svrls0619
    @svrls0619 День тому

    Great video.

  • @SizarieldoR
    @SizarieldoR 6 днів тому +4

    Could you do a video about the job market situation currently?

  • @Abc-sl1nf
    @Abc-sl1nf 13 годин тому

    Thx!

  • @fischi9129
    @fischi9129 День тому

    ah yes, we are in 2024 and we still like to pretend that linked lists have a reason to exist -.-

    • @TurdBoi-tf5lf
      @TurdBoi-tf5lf День тому +1

      Elaborate

    • @fischi9129
      @fischi9129 День тому

      @@TurdBoi-tf5lf reallocating a bigger/potentially smaller array as needed outperforms Linked lists under pretty much any aspect. You can also just double it when increasing and you would still use the same amount of memory than a linked list even if you don't use the elements. That's the reason why a lot of languages e.g. Java have ArrayLists and not LinkedLists as a standard List implementation. Lists are slower under pretry much any aspect, they use more memory and they often are trickier to work with... why do we use linked lists?
      Oh btw, adding a lot of things or removing a lot of things is still slower for Linked lists than arrays since you have a lot of syscalls (which is pretty slow overall)
      And python decided to use Linked lists instead of arrays 🤡

    • @fischi9129
      @fischi9129 22 години тому

      ​@@TurdBoi-tf5lf oof, I was sure I elaborated already. Anywhays, Arrays use less memory, are faster to exoand and even faster to iterate over. As a matter off acts, iterating over an array of less than 5k elements in C is generally faster than using a hashmap. The memory is self explanatory, the array has a fat pointer to the start (or normal pointer) and then you go trough it. The Linked list has generally around double the memory consumption (pointer to next address which generally is 64-bit number, and the value (often also a pointer). Now surprisingly normal arrays are often faster when expanding as well because you only have 1 (or maybe 2) system calls for expanding (normally doubling) the content in the array. For linked lists you have a syscall per item. So lists are slower add a lot of data, they are slower to iterate over, have no random access and consume around half the memory.
      This is alos the reason why pretty much every langiage that takes performance even remotely seriously implements lists as ArrayLists (Dynamic Arrays, vectors, call them how you like), and not as LinkedLists. Also, most algorithms on linked lists are significantly slower than arrays. Small bonus. Iteration over arrays is so fast because your CPU doesn't just load the data it needs from the RAM into it's cache, but it loads memory blocks. When it loads a memory block of array data, it automatically loads quite a few elements of the array, and therefore has more cache hits. LinkedLists are across the heap, therefore cache hits are honestly more the exception than the rule

  • @carloking2163
    @carloking2163 5 днів тому +1

    Shout out to all the homies nodding along with NO DOGGARN CLUE WTF IS GOING ON... I'm here with you bro

    • @charleschukwuemeka8482
      @charleschukwuemeka8482 3 дні тому

      Like... I know about arrays and lists but for others... I don't know what the F is going on

  • @Felix_Tpr
    @Felix_Tpr 5 днів тому +1

    Nice explanation, but the heap comes a little short here ;)

  • @charleschukwuemeka8482
    @charleschukwuemeka8482 3 дні тому +1

    As a JS, TS and Go Web Developer... I am yet to find the usage of most of these data structures. I have used arrays, list, hash tables or tables.. but apart from these ones, I haven't seen the usage of others.

    • @SirDonald
      @SirDonald День тому

      Heaps can be quite valuable in e-commerce for tracking the top k most sold items. This is a useful metric for identifying where to focus your efforts and also helps in creating bestseller lists or targeted promotions for customers.

    • @imqqmi
      @imqqmi 8 годин тому

      What about the DOM, that's a tree data structure with references to it in CSS with selectors. If you make a chat function with a queue with a fifo buffer for retry/ack functionality etc. Sometimes you may need to use open street maps, the geo data it contains is not always key/value, it's also a tree of json data that needs to be traversed. You can do that recursively, then you need to know about the underlaying programming language stack handling. If the recursion goes too deep you run into issues.
      JS and other language and frameworks tend to hide all that but it's good to know that they're there and you're actually using them.

  • @xav_624
    @xav_624 6 днів тому

    Except Java, it's all very good content 😉

  • @bjmaldonado
    @bjmaldonado 6 днів тому

    * looks at PC *
    Tell me you have small children without telling me

  • @JohnWasinger
    @JohnWasinger 3 дні тому

    So what is a JavaScript array? Is it like a doubly linked list that contains pointers to malloced chunks of memory and a size of the malloced element?

  • @RandyAugustus
    @RandyAugustus 3 дні тому

    “Stuff you should know if you want to get hired, but then never use because there’s libraries for all this”.

  • @boitumelolefophane2365
    @boitumelolefophane2365 6 днів тому

    I liked this video a lot, really does remind me of my first year in CS

  • @Tewahedo
    @Tewahedo 4 дні тому

    Hi, can I please get a link for your keyboard? It looks awesome and I wanna buy one, thanks.

  • @icantchosemyname
    @icantchosemyname 3 дні тому

    I really think we should be cautious about "things that every programmer should know".
    In a computer science cursus you learn lots of concepts and stuffs, but it depends on what branche you'll be working in after graduating. For instance as a web dev, you'll mostly only work with an array.
    If you do work with lower level langages like C, then you might use more sophisticated data structures to use less memory or less cpu.
    Si to people desiring to switch job and start programming, Please ask round you what data structures are really used
    And save your time.

  • @d3nnispaz
    @d3nnispaz 3 дні тому

    Amazing video. Does any know what type of font he use?

  • @phillipwombacher9635
    @phillipwombacher9635 4 дні тому

    bro im a nurse teaching myself how to code and this is excellent stuff thank you!

  • @Dwyaneish
    @Dwyaneish 5 днів тому

    This video is great and makes these topics easy to understand, thank you so much Forrest!

  • @joshuajibi4249
    @joshuajibi4249 7 днів тому

    Valuable content

  • @milxzy
    @milxzy 7 днів тому

    first!

  • @curiousstreamer4062
    @curiousstreamer4062 6 днів тому

    first

  • @aimenyaugba6892
    @aimenyaugba6892 7 днів тому

    Noted....2nd

  • @aliksant90
    @aliksant90 6 днів тому

    Nice

  • @lazyman2451
    @lazyman2451 7 днів тому

    Nice

  • @MrHaggyy
    @MrHaggyy 4 дні тому

    Uh the good old c-queue that is actually an array and goes lightning fast, if you only use bit manipulation, because your CPU does a quadrillion of those before it read in a line of RAM, completely obliterating any O() notation when you measure the actuall execution time in many cases.

  • @infraia
    @infraia 5 днів тому

    Great video! Thank you sir !

  • @anon_y_mousse
    @anon_y_mousse 5 днів тому

    The one point I disagree with is about the definition of an array. Same type for each slot and contiguous memory storage, yes, but not statically sized. And there's a lot more complexity to hash tables if you care to make a more complete description there. You have different hashing algorithms, balancing schemes, and even storage methods. For instance, in one implementation, I made the storage backing for a hash table as a balanced tree and each node was also part of an interlaced series of trees that were the chains. It used up a lot more memory than either a tree or a hash table alone, but it was an interesting experiment in maintaining sorted order while yielding slightly faster searches.

  • @ridrox
    @ridrox 3 дні тому

    can you tell me your keyboard and model name please

  • @georgehammond867
    @georgehammond867 4 дні тому

    your keyboard name is.?

  • @anuvabkumarrit4669
    @anuvabkumarrit4669 5 днів тому

    Great explanation

  • @Rich65501
    @Rich65501 2 дні тому

    Super video.

  • @BrownDavid586BD
    @BrownDavid586BD 3 дні тому

    Thanks

  • @ahmedal3761
    @ahmedal3761 6 днів тому +1

    I was wondering if you may go deeper in another video series for each data structure with a coding example on how to build them and where we can find them in real world applications?

  • @ahmedal3761
    @ahmedal3761 6 днів тому

    True golden nugget. In 17 minutes, you simplified what my professor couldn't in hours of lectures!!!

  • @mateussarmento7692
    @mateussarmento7692 6 днів тому

    Dude stop

  • @theintellect5004
    @theintellect5004 6 днів тому +3

    Don't be trapped. Paid Programming is moving to India. Get a different trade folks

    • @Homelander_30
      @Homelander_30 6 днів тому +3

      What u mean?

    • @josemonteiro5988
      @josemonteiro5988 6 днів тому +1

      He is brainwashing you​@@Homelander_30

    • @ogcurated
      @ogcurated 6 днів тому +2

      Lmfao 😂

    • @sirmewo5510
      @sirmewo5510 5 днів тому

      Super power saar

    • @StingSting844
      @StingSting844 3 дні тому +2

      I'm a dev from india and this is true. During the recent layoffs they cleared out all of US/UK offices except the sales folks. Now that the feds have slashed interest rates they have started hiring here in the Bangalore office

  • @Microphunktv-jb3kj
    @Microphunktv-jb3kj 5 днів тому

    10:14 - url for that chart?