Ranking Every Data Structure & Algorithm

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

КОМЕНТАРІ • 119

  • @ColinGalen
    @ColinGalen  2 роки тому +70

    Some have mentioned stuff about resources for each topic I mentioned, and I think that's a good idea. Here's a rough dictionary for each mentioned topic: docs.google.com/document/d/1mKRZ743RBD9Ta4I5qNg3S6pO5ayVb2DH2YRCIB24_iM/edit?usp=sharing
    Note that it's a work in progress.

  • @davidde7620
    @davidde7620 Рік тому +41

    You had me at - I still make errors using Binary Search, even though it's an easy concept to learn and implement.
    I am glad I found your channel; it brings so much of human touch into the egoistical world of coding interviews and competitive programming, where I must be stupid that I keep making off-by-one errors is rampant.

  • @junhuang9047
    @junhuang9047 Рік тому +9

    Timestamps by tier
    S tier
    1:11 BFS / DFS
    25:03 Sorting
    A tier
    2:44 Binary Search
    7:47 Dynamic Programming
    11:29 Greedy
    12:31 Hashmap / Hashset
    13:37 Heap
    14:55 Linked List
    19:22 Prefix Sums
    27:39 Stack
    32:17 Topological Sort
    B tier
    1:40 Binary Search Tree
    4:07 Brute Force
    8:52 Fenwick / Segment Tree
    19:58 Prime Factorization
    21:05 Queue
    22:14 Recursion
    28:47 String Hashing
    35:26 Two Pointers
    36:26 Union Find
    C tier
    3:15 Bitwise Operations
    5:05 Combinatorics & Probability
    10:05 Game Theory
    14:01 Knuth-Morris-Pratt
    16:00 Lowest Common Ancestor
    18:22 Modular Arithmetic
    23:38 Shortest Paths
    33:50 Trie
    D tier
    5:54 Convex Hull
    6:57 Divide and Conquer
    17:26 Minimum Spanning Tree
    26:14 Sqrt Decomposition
    31:06 Strongly Connected Components
    F tier
    8:28 Fast Fourier Transform
    17:04 Max Flow

  • @stephanbranczyk8306
    @stephanbranczyk8306 2 роки тому +6

    Modular Arithmetics is needed to avoid overflows. It's used for hashing. It's used in all kinds of questions. Plus, it's easy to learn. I would have put it much higher.

  • @casualBob7
    @casualBob7 2 роки тому +6

    as an amateur CP i love your content, always so insightful and interesting

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

    A perf video summerizing almost all useful DS, Algos

  • @ztrixx3280
    @ztrixx3280 2 роки тому +2

    The things you said about recursion were so ON POINT!!!
    "I know it, but i don't". Mahnn it sucks!

    • @anatolyklimenko
      @anatolyklimenko Рік тому +3

      In order to understand recursion you need to understand recursion

  • @Blackfir333
    @Blackfir333 2 роки тому +15

    Colin, could you make a video outlining general strategies and patterns on when to use which data structure? A lot of people (including me) struggle to recognize when to use a monotonic stack for example. Like, I understand we use it when the problem is reducible to finding the next greatest elements or the sliding window maximum, but what else?

  • @nikhil_a01
    @nikhil_a01 Рік тому +16

    At 35:50 Colin mentions that the implementation of two pointers can be tricky, especially if you're taught the wrong way.
    What is the wrong way? Does anyone have links to resources showing the right and wrong way?

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

      phrased it perf! Im really worried cause I find two pointer hard I cant seem to identify the two pointer solution to problems!

    • @pablobear4241
      @pablobear4241 4 місяці тому +1

      @@fakedevdutt I would recommend learning a few things.
      First learn how to reverse a string using two pointers in java/c++.
      Then I would move onto just like a basic/general two pointers approach algorithm.
      Then I would solve two sum using two pointers.
      Then 3 sum using two pointers.
      I think this is an okay way to learn two pointers, but, I'd also just watch videos or just like literally reverse a string on paper using it and that should teach you it.

  • @wesleyso0
    @wesleyso0 2 роки тому +6

    Really cool to see new perspectives on things. Thanks for such a unique and interesting video!

  • @loveforallbxlmannif
    @loveforallbxlmannif 9 місяців тому

    Depend also of what you want to program, in dsp fast fourrier and bitwise operation are very useful.
    Fourrier transformation is not so hard even if it seams. You take a number of sample, now you need to make complex number with it, for this you make a convolution multiplying those sample with sin and cos at certain frequency. then add those complex number and you know if a frequency close to the one tested is present in the signal. For Fast fourrier it's a little more complex but not so much, it's possible to bypass some of those multiply calculation..

  • @karolinaa9478
    @karolinaa9478 Рік тому +2

    I think Divide and Conquer should be higher, I've definitely seen it way more often than bitwise operations or game theory in interviews.
    Also, in my interviews with FAANG they seemed to not like Segment Tree as an approach when there was a simpler approach, eg they dismissed the solution outright (probably also because the interviewer themselves was not super familiar with the DS)

  • @darioabbece3948
    @darioabbece3948 2 роки тому +6

    I really hoped you would have put on screen the definition of the topics once introduced

    • @ColinGalen
      @ColinGalen  2 роки тому +8

      Good point. I'll add a glossary (soon). Check the pinned comment in a day or so, and/or remind me if it's not there.

  • @gokusaiyan1128
    @gokusaiyan1128 2 роки тому +3

    When you said about subarrays at 19:50 , my first thought is usally sliding window not prefix sum :/

  • @improvidancer
    @improvidancer Рік тому

    hands movements are great!!!

  • @ngoquangtrung234
    @ngoquangtrung234 2 роки тому +3

    Can you make a video about mathematical subject to understand algorithm and data structure? And any advise for books to learn algorithm and data structure .

  • @nikhilnagrale
    @nikhilnagrale 2 роки тому +4

    Amazing content idea

  • @tranminhhieu9492
    @tranminhhieu9492 2 роки тому +3

    Where would you put Backtracking?

    • @TrenBlack
      @TrenBlack 9 місяців тому

      brute force and recursion are both in B

  • @EZboyrocks
    @EZboyrocks 2 роки тому +5

    I think I would prefer if you ranked just purely off of usefulness for coding interviews rather than factoring in being easy to learn

  • @juanmoscoso0
    @juanmoscoso0 2 роки тому +7

    why are you ranking on how hard it is? you should be ranking on usefulness

  • @maxhaibara8828
    @maxhaibara8828 2 роки тому +4

    you can't just put both of my most favorite algorithm in the F tier list

  • @GeminiZeroX
    @GeminiZeroX 2 роки тому +29

    While I generally agree with you. I'm disappointed in your choice to drop FFT in F-tier without mentioning how immensely useful something like FFT is in reality. Anything these days to do with audio engineering likely uses FFT inside. Polynomial multiplication. Signal processing. It's honestly an incredibly vital and beautiful algorithm that isn't terribly hard to understand. I highly recommend anyone interested check it out.

    • @gregorymorse8423
      @gregorymorse8423 2 роки тому +2

      saying FFT is F tier was pretty ridiculous. Dude doesn't know what time and frequency domain are and the multitude of cases when going between them is necessary

    • @user-dh8oi2mk4f
      @user-dh8oi2mk4f 2 роки тому +13

      @@gregorymorse8423 In the beginning of the video, he stated that they would be ranked in terms of helpfulness for *coding interviews*. FFT probably isn't very important for that.

    • @gregorymorse8423
      @gregorymorse8423 2 роки тому +3

      @@user-dh8oi2mk4f if the company does signal processing, then it might be the most important question. Just depends on the specific sector

    • @hil449
      @hil449 11 місяців тому

      Too niche

  • @illymns3339
    @illymns3339 2 роки тому

    Really nice video! Going to come back to this one day xd

  • @tranminhhieu9492
    @tranminhhieu9492 2 роки тому +1

    Great video. Subscribed

  • @janmichaelaustria620
    @janmichaelaustria620 2 роки тому

    Yo, Colin you're a boss man! I think you should include Rabin Karp and rolling hash in here too. But that may already be a consequence of having KMP in there. Also could you rank minimax, and some more advanced trees like AVL, redblack, and Van Emde Boas trees. I've seen a comple minimax questions on LC

  • @marcotroster8247
    @marcotroster8247 2 роки тому +3

    You didn't rate any techniques for fuzzy queries or estimation algorithms that are data science related. Stuff like cosine similarity, inverted index, entropy, some AI training algos like gradient descent, etc. 😂
    I know it's a bit of an advanced topic for CS master students, but I think computing exact results is a lot easier than estimation techniques. So, estimations are actually a nice tool for solving hard problems like travelling salesman or face recognition. Prob out of scope for leet code questions, but yeah 😄

  • @philstanton8912
    @philstanton8912 2 роки тому +3

    How on earth are divide and conquer algorithms d tier? Dynamic programming is definitely a superior to divide and conquer, but some of the most important problems in cs are solved via divide and conquer

  • @The.Anime.Library
    @The.Anime.Library 2 роки тому +2

    does this tier list also work for competitive programming ? thanks

  • @coced
    @coced Рік тому

    -You may be confused about [...]
    -Yes

  • @alexanderoneill6160
    @alexanderoneill6160 2 роки тому +4

    FFT is the most useful algorithm ever anything involving periodic signals will use FFT it should easily have its own S+ tier.

  • @jyothishkumar3098
    @jyothishkumar3098 2 роки тому +4

    Fast Fourier Transform is very useful in DSP, but not in DSA. It should get S but it also shouldn't be in this video.

    • @caiodavi9829
      @caiodavi9829 11 місяців тому

      what the fuck is DSP

    • @joshgundy9885
      @joshgundy9885 10 місяців тому

      ​@@caiodavi9829 Digital Signal Processing. It's an Electrical Engineering thing mostly, I think.

  • @obeytweety
    @obeytweety Рік тому

    Colin i love your videos!!

  • @novelspace
    @novelspace 2 роки тому +4

    Did you just call fft an f? Imo the rest of this list is null bc of that.

  • @noobnessmee
    @noobnessmee 2 роки тому

    Petition to put DP at S tier. Come on man, it deserves it

  • @SakshamSharma-tr9fk
    @SakshamSharma-tr9fk 2 роки тому +3

    I remember seeing a binary search video from your channel in my recommendation and I saved it for later, but now I am not able to find it.
    Did you delete it? If so, why?

  • @abhiupadhyay3615
    @abhiupadhyay3615 2 роки тому +3

    Great video. But can you give an exhaustive resources for these topics particularly for the main one's which you feel are too necessary for interview and by exhaustive I Mean like totally full resource cause I wanna learn more and be like you. Thank You for your great content Keep up buddy

  • @prabhpreetsingh5341
    @prabhpreetsingh5341 2 роки тому +2

    Binary Search not in S Tier. Um Nik is not happy

  • @lucabrasi49
    @lucabrasi49 2 роки тому +1

    Is there a video on how he went from knowing none of these topics to being an international grandmaster ?

  • @FelixNielsen
    @FelixNielsen Рік тому

    I have to disagree with the positioning of bitwise operations. It is not difficult and certainly not of you're able to think like a programmer should be able to, and it is indeed useful, though it may take experience to recognize when and where. When you do however, it can make a huge difference.

  • @alexgabriel5877
    @alexgabriel5877 2 роки тому +1

    nice vid! would've been cool if you gave a TLDR about the topics :)

    • @ColinGalen
      @ColinGalen  2 роки тому +2

      Good point. I'll add a glossary (soon). Check the pinned comment in a day or so, and/or remind me if it's not there.

  • @sean7185
    @sean7185 2 роки тому +1

    What is FFT used for? I've only ever heard of it used for digital signal processing for audio

    • @brownketch
      @brownketch 2 роки тому +5

      rf applications (radar, cell, radio), image processing

    • @sunahgamer321l4
      @sunahgamer321l4 2 роки тому +4

      Any sort of dynamic signal analysis and control, you can use the fft and build filters in the frequency domain to control the output of a system. The fact that this man said fft is useless because you don't see it in interviews makes me think this man has never truly written any useful programs.

    • @vladimirleon2487
      @vladimirleon2487 2 роки тому +3

      I use FFT driven software for analysis of machine vibrations literally ALL the time. Any time you have a signal in the time doman but would like to jump to easier frequency domain, it's literally a must. His dismissal of it made me very disappointed. But I think these are general thoughts on "learn coding".

    • @sunahgamer321l4
      @sunahgamer321l4 2 роки тому +2

      @@vladimirleon2487 yeah I think its dumb is that typical algorithms courses spend more time on typical solutions, or I guess you could say "algorithmic" solutions to programming problems, when most people know that a lot of solutions to problems aren't traditional solutions. Most of the time, the most optimal solution is something very niche and untraditional like the quake algorithm. This is why I study Electrical engineering and not computer science.

    • @hil449
      @hil449 11 місяців тому

      This tier list is about interviews dude. Who asks a fft problem in an interview?

  • @VITS-tu6qy
    @VITS-tu6qy 2 роки тому

    Thanks man

  • @joakimolovsson7310
    @joakimolovsson7310 2 роки тому +2

    Is this tier list for competitive programming as well? :)

    • @EragonShadeslayer
      @EragonShadeslayer 2 роки тому +3

      Pretty sure this is specifically for competitive programming

  • @koffiegast
    @koffiegast 2 роки тому +1

    Probability > C
    Fast Fourier Transform > F
    RAAAAAAAAAAAAAAAGEEEEEEEEEEE

  • @johannes8144
    @johannes8144 2 роки тому +1

    Where would you rank "Treap" 's ?

    • @ColinGalen
      @ColinGalen  2 роки тому +2

      For interviews, definitely an F. For competitive programming, they are very advanced, but also extremely powerful, so it depends. If you're anywhere below grandmaster, it's also an F, but if you're my level, it probably belongs in C-D (but it also depends on what you're training for; they'll be much more common for IOI-type stuff than CF).

  • @susrandomguy
    @susrandomguy 2 роки тому

    Thanks man.

  • @johntaylor374
    @johntaylor374 2 роки тому +1

    Have you ever covered Monotonic Stack. Don’t recall seeing it in any of your streams yet. Does that fit into stack or different dsa?

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo 2 роки тому +1

      Yes, very much so. Look through his videos

  • @anoyq56
    @anoyq56 2 роки тому +1

    Are you from Delaware?

  • @proofhundred986
    @proofhundred986 2 роки тому

    Just Higher The Volume By A bit, im maxed out on volume and its sometimes difficult to understand

  • @akashbhoi1951
    @akashbhoi1951 2 роки тому +2

    Please make a series on advanced dp

  • @vaalarivan_p
    @vaalarivan_p 2 роки тому +1

    5:00

  • @4mb127
    @4mb127 Рік тому

    If you don't understand Fourier Transform you are completely crippled when processing any video or audio.

  • @leosin5767
    @leosin5767 2 роки тому

    Nice explanation! But just wanna say pointers are just not hard tho

  • @mdyousufgazi4030
    @mdyousufgazi4030 2 роки тому

    nice video

  • @abdulmuqtadir8898
    @abdulmuqtadir8898 2 роки тому

    What a legend

  • @wlanwlan4627
    @wlanwlan4627 2 роки тому

    I feel like it is just problematic to say bfs/dfs, but not stacl/linkedlist because you often use them to implementent those algorithms.

  • @trungsaudam
    @trungsaudam 2 роки тому

    I though two pointer worth S?

  • @chuckynorris616
    @chuckynorris616 Рік тому

    what planet is this creature from

  • @williamchamberlain2263
    @williamchamberlain2263 Рік тому

    Nice title :)

  • @xorcerer
    @xorcerer Рік тому

    POV an 1500 rated guys tierlist for algorithms

  • @sunnyrawat931
    @sunnyrawat931 2 роки тому

    I'm here to see topics i don't learned yet 🌚.

  • @connorhughes4582
    @connorhughes4582 2 роки тому

    you can roughly trust me

  • @rupanugapmishra7128
    @rupanugapmishra7128 2 роки тому +1

    can you do a tier list of dsa for competetive coding?

    • @ganeshchowdhary3024
      @ganeshchowdhary3024 2 роки тому +1

      Everything. CP is problem solving and to solve a problem u might need anything

  • @namoan1216
    @namoan1216 4 місяці тому

    where is recursion?

  • @jinmori7561
    @jinmori7561 2 роки тому +2

    I thought u are a girl and when I watching it i was confused for a while that why I hear male voice instead female

  • @aligohar1708
    @aligohar1708 2 роки тому +3

    If i do S and A only, is 2000 rating possible

    • @mackvanzanden4882
      @mackvanzanden4882 2 роки тому

      yes

    • @phamtuanthanh1654
      @phamtuanthanh1654 2 роки тому +6

      If you don't know segment tree, you don't know bitwise operators, you DON'T even know brute force or any bit of combinatorics.... In short, no (unless you pour your entire lifetime's luck into codeforces contests).

    • @mackvanzanden4882
      @mackvanzanden4882 2 роки тому

      @@phamtuanthanh1654 haha true

    • @mackvanzanden4882
      @mackvanzanden4882 2 роки тому

      except seg tree u can def get to 2000 without it

    • @phamtuanthanh1654
      @phamtuanthanh1654 2 роки тому +1

      @@mackvanzanden4882 segment tree can be a huge rating boost factor sometime tho :)), it is versatile and quite easy to learn too

  • @raphaelnej8387
    @raphaelnej8387 Рік тому

    FFT is useless 😳
    But it’s so coool.

  • @rafaelelmachs
    @rafaelelmachs 9 місяців тому

    Bro i didnt was expecting you with long hair

  • @cmdv42
    @cmdv42 2 роки тому

    💯✨

  • @mrseanpaul81
    @mrseanpaul81 2 роки тому +3

    Your list is meh (in my opinion) and may be very "competitive programming" oriented. I have never participated in any competitive programming tournament. I don't think prefix sum (which I have never heard of before this video) belongs to A. I also think "two-pointers" deserve much more love than you give it. Hash and linked list should be in "S", as I interpret "S" to be "if you don't know these things, don't even attempt technical interviews". Topological sort and Fenwick/Segment tree (never heard of that before) should be a rank lower (in my opinion).
    Anything in A and B should be known before interviews (after applying my mods). A few topic in C are definitely "good to have". Everything else is for the birds (if one's goal is to pass technical interviews)

    • @mihailmojsoski4202
      @mihailmojsoski4202 2 роки тому

      a tree is bunch of hashmaps

    • @user-dh8oi2mk4f
      @user-dh8oi2mk4f 2 роки тому

      @@mihailmojsoski4202 Do you mean all trees or just fenwick/segment trees?

  • @2023-c9p
    @2023-c9p 2 роки тому +1

    🧐🧐🧐

  • @ItzItzJARED
    @ItzItzJARED 2 роки тому

    goat

  • @jelez0bet0n90
    @jelez0bet0n90 Рік тому

    fundamentally disagree. stack and recursion is tier S, and dfs is literally simplest apply of both recursion and stack, placing dfs in S and stack|recursion in B&C is soooo weird

    • @jelez0bet0n90
      @jelez0bet0n90 Рік тому

      also dfs is so much more useful than bfs, weird that they are combined. and also so many things not included like suffix array, comp. geometry (only convex hull), and many others (???) who did this tierlist lol

  • @skyhappy
    @skyhappy 2 роки тому +1

    Why do you have long hair

  • @nithinkumar6105
    @nithinkumar6105 2 роки тому

    Hi

  • @hil449
    @hil449 11 місяців тому

    Why did you make this tier list for interviews? You have alot more knowledge about CP, and this video ended up being heavily biased towards CP. I think a tier list about interviews would be better made by an actual interviewer at a big company or someone with more experience in the market than you. Excuse my broken english lol