Best Books for Learning Data Structures and Algorithms

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys how's it going so today i want to share a few books with you that i think will help you get better at data structures and algorithms these books are not only useful if you're trying to learn data structures and algorithms for your school or your day-to-day work as a software engineer but also with technical interviews in mind so without further ado let's begin before you begin if you're new here i make videos on software engineering productivity technical interviews and that kind of stuff and if you're into similar things please subscribe and hit the notification bell icon so that you don't miss any new videos all right let's begin so the first book i recommend is this little guy called computer science distilled i came across this book probably a year ago and i think it's an amazing book just to get your head around all the topics that exist in computer science just by looking at the size of the book you'll probably guess that this is probably not an exhaustive list or a detailed explanation of the material but i think it's an amazing starting point that will at least get you familiar with the topics that exist in the space it briefly touches all the topics that you need to learn in order to be good at data structures and algorithms especially for your technical interviews it's also very light-hearted and has a good sense of humor so it's not very dense to read so even if you are just a beginner software engineer or you just started taking classes or you're switching from a different field this is a really nice and easy read to get started so this book is pretty interesting it covers your basics like ideas logic counting probability that you'll need as foundations before even starting algorithms it also has the introduction to your big on notation counting time and how things get slower or faster as your data size increases then it has the strategy section that will cover like iteration recursion backtracking dynamic programming again i can't stress enough that this is just an introduction to all these topics i mean some of these topics are huge like dynamic programming and they cover that in three pages like there's no way but the goal of this book isn't to make you an expert on any of this topic it's basically to help you sort of build the dictionary of topics in your head let's look at an example of what i mean right like there's a section here that talks about hash table it says the hash table is a data structure that allows finding items in constant time searching for an item takes constant amount of time whether you're searching among 10 million or just 10 items okay you get the rough idea you don't know in depth about what a hash table is but it looks like it is pretty efficient and it stores things and you can retrieve them in constant time by now if you've followed this book you've probably read the bigger notation so you kind of have a rough idea about what constant time means so that's cool similarly to the array the hash requires pre-allocating a big chunk of sequential memory to store data okay but unlike the array the items are not stored in ordered sequence the position of an item occupies is magically given by a hash function so this is what i mean this book introduces the topic to you but there are some of the harder topic like how the lookup is constant time or how the hash table gives you such performance is sort of magic right it's not going to explain you in depth how a hash table works but i think it gives a great introduction just one page so that you kind of get a very high level and basic understanding of what a hash table is and this is very similar with everything else it's like there's a section in graph we've seen graphs are the flexible data structure that use nodes and edges to store information they're widely used to represent data like social networks nodes are people edges are friendship relationships telephone networks nodes are telephones and stations edges are communications and much more that's it and then the next topic goes for searching in-depth searching in graph via depth research we keep following edges going deeper and deeper and then they illustrate that via a nice graph again to illustrate my point you get the idea but you're not going to get a full understanding final comment on this book is just the size itself it's so nice and light and compact easy to carry around then you can literally throw it in your backpack especially if you're a student and when you get your free time or break you just pull it out read it or if you're traveling probably not right now during covet but you know regular travel you can just carry it with you you know just refresh some topics you know it almost makes a very serious topic like data structures and algorithms kind of fun with little colorful diagrams and just the size of the book so highly recommend it especially for beginners so once you've graduated from that book you want to go ahead and get this book called rocking algorithms this book also follows a very similar pattern of being very lighthearted funny lots of diagrams to illustrate the point but goes in more depth compared to that book so once you've read that book and you've sort of have a vocabulary of words you've learned that there's thing called hash tables that exist you've learned that there's graphs and how they represent relationship between things and you can search through them via depth first or breadth first and you can do certain algorithms on them but you have no clue how to do them right like that book doesn't give you any algorithms like actual pseudo code or any code it's just an understanding and overview this is very similar but it goes into a little bit more detail and then the table of contents for this book is very similar you'll still get a bigger analysis you'll still get the sorting algorithms the basic data structures greedy algorithms searching dynamic programming that kind of stuff but because you can see it's thicker it's larger it does go into more depth it's like if that's level one this is gonna go level two i'm gonna focus on the same example for each of these books so you kind of get how in-depth they go so let's look at what this book has to say about hash tables in the other book you've learned that hash tables can give you constant time lookups and sort of how hash function makes that happen is magic right in this book however they talk about hash functions what is a hash function how does it store things and then there are a bunch of examples really nice and then it talks about like time complexity how a performance of hash table is not guaranteed right like if your hash function is bad or not efficient then you're not going to get a constant time lookup and then at this point you're like wait but the other book told me that it sort of magically happens right like it happens for built-in hash functions and stuff but now you want to understand what the magic behind it is this book's going to explain you that and then it also talks about collisions that's what happens when a hash function tries to insert two different values to the same spot that's when collision happens and then it sort of introduces that and then it also talks about when the hash function can resize and that's called maintaining a load factor see look those things you didn't know in that book but now you're gonna understand in this book right and again let me re reiterate that this is also a very light read it doesn't have any code it doesn't give you pseudo code it just gives you very illustrated examples and lots of graphs and diagrams to show you or to help you understand the idea even better than that book so i think it's a very natural progression to go from that book to this book and still till now you can go through these books without having much data structures and algorithms experience you don't need that much so even if you are like in school and you just started taking like the basic classes and you wanted to go a step ahead and kind of like get started early these are great books to get started or if you're into like mechanical engineering or different sort of engineering you want to get to coding or you you're thinking about prepping for a big fan company interview like top tech company interview and you don't know what sort of topic you need to cover these two books will sort of give you an idea and you can gauge your understanding you know these may come very naturally to some people and these books do help in that they don't talk about it in the technical jargon that most books do and it's very natural and they give real life examples so it's kind of help you grasp the topic so i think these are this is a great second book to have and then once you've figured that out maybe you've done your own research you've gone online you've looked at it in a little bit of depth and you kind of wrote some code you're you're in school and now you've taken the data structures and algorithms class that's when you bring in the big boy and this is this is a big one and it's it's almost like the bible of algorithms book it's called introduction to algorithms this as everything again those two books have same topic but in this book you will see much more technical detail it will cover everything you left pseudo code you love your mathematical analyses and everything you really need so let's look at the same thing on this guy all right in this case now we're talking about time complexities to begin with even in the first paragraph itself it starts talking about collisions but then it talks about how do you solve collisions and there's a technique called chaining it talks about that it'll give you much everything is in mathematical notation here and there are theorems and proofs and how you can get amortized constant time or you know like uh upper bound and a lower bound to your time complexity is very mathematical at this level if you're understanding algorithms and if you've gotten this far you're you're good to go you know same with graphs representations of a graph we can choose between two standard ways to represent a graph where graph is a set of vertices and edges as a collection of adjacency list as an n or an adjacency matrix either way applies to both directed and undirected graph because the adjacency list representation provides a compact way to represent sparse graph those where the edges are much lesser than the vertices and usually that's the method of choice as you can see it didn't may take any effort to explain like how oh graphs are like social networks and telephone communications that kind of stuff it's going directly to the mathematical and very uh technical uh lingo here but if you have graduated from those two books i think this is the book that you eventually want to get to because this will give you like the real implementation details and thorough understanding of algorithms but i do want to add a note here that you don't really need to know everything in this book like some of it is super mathematical you don't get carried away by this and that's also the reason that i did not recommend this book as number one because if you've never really done data structures and algorithms you're just starting and you take a look at things in this book you will you'll quit computer science i'll i'll promise you that but trust me once you once you go through the other two books and you have a good understanding of what algorithms are and what sort of things they do maybe like brush up on some math like both those book covers like some discrete math and probability counting that kind of stuff you'll find this uh much more approachable and then the final book i had for you is this is this ties very directly to technical interviews not just like learning as a software engineer it's called elements of programming interviews um this is a great book mine is an older edition i think it's like eight or ten years old so it's in c plus plus and you can get this um in java and python these days so i'll link both of those in the description below but this is a very technical interview question first approach compared to the other two books so this is a great one to either use side by side as you're learning topics or maybe go through all of them and once you feel comfortable start kind of looking into this and the chapters here are organized in a very similar approach because like like i said like the topics are same right like so you'll talk about hash table it's gonna give you a brief introduction of what a hash table is but after that it's just gonna go to a problem right like for example design a hash function for a chess game to maintain the states your function should take the state and the hash code for the state and the move and efficiently compute the hash code for the updated state so this is like a real practical implementation of hash code or a usage of ash code right away right so the other question is let s be an array of strings write a function that finds the closest pair of equal entries so not only are you learning the data structures but this will actually give you real life examples on how you can use that data structure or an algorithm to solve interview type questions i know a lot of you guys also have lead codes so maybe lead code and this is unnecessary but if you think of it lead code is like 160 a year so that's more than 10 bucks a month you know but this is going to be a like 30 40 bucks and honestly like if you can solve almost all questions on this book you don't need anything else like this not only gives you thorough explanations of how this works but it's written from engineering leaders from all of the big companies you know so i highly recommend this book so those are the three uh four books that i recommend for getting better at data structures and algorithms one final note that i wanted to add is i do suggest that you at least have an understanding of basic constructs of programming and very elementary data structures like what is an array what is a string what are primitive types what is an int what is a float how do you you know initialize variables or how do you write an if else condition how do you write a for loop while loop that's it that's that if you know that much then you'll start understanding what these are but if you if not maybe the first two books are still approachable but after that um you you'll get in trouble but um and for those um there are many free resources online that you can learn or if you're in school they're already probably teaching you but i will share a couple of other courses that are from uh really good universities and they're free on youtube so you can kind of watch those videos together with these readings and that should help you out a lot that's it if you have any questions write them in the comment below i'll try to respond to each of them if you have a question that pertains specifically to you then reach out to me on instagram and dm me and i try to respond to those too so until next time see ya bye [Music]
Info
Channel: Engineering with Utsav
Views: 154,742
Rating: undefined out of 5
Keywords: Best books for learning data structures and algorithms, data structures, data structures and algorithms, programming, computer science, coding interview, software engineering, computer science for beginners, data structures and algorithms in python, data structures and algorithms in java, data structures and algorithms mit, programming books for beginners, algorithms, data structures tutorial, learn to code, introduction to algorithms, computer science books, learn data structures
Id: FWmuxvOgh6Q
Channel Id: undefined
Length: 14min 1sec (841 seconds)
Published: Thu Dec 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.