GROKKING ALGORITHMS: Advanced Methods to Learn and Use Grokking Algorithms and Data Structures for Programming
By Eric Schmidt
()
About this ebook
Welcome to Grokking Algorithms: Advanced Methods to learn and use Grokking Algorithms and Data structures for Programming.
Even before the conception of the computer itself, algorithms existed. After the computer was introduced and with all the development that followed, the number of existing algorithms grew increasingly. At t
Eric Schmidt
Eric Schmidt (Washington D.C., 1955) es un empresario e informático estadounidense, director ejecutivo de Google desde 2001 hasta 2011. Actualmente es el presidente ejecutivo de la empresa. En agosto de 2015 fue escogido como presidente de Alphabet Inc. después de la reorganización empresarial de Google.
Read more from Eric Schmidt
CODING INTERVIEW: Simple and Effective Methods to Cracking the Coding Interview Rating: 0 out of 5 stars0 ratingsGROKKING ALGORITHMS: Simple and Effective Methods to Grokking Deep Learning and Machine Learning Rating: 0 out of 5 stars0 ratingsARDUINO PROGRAMMING FOR BEGINNERS: Tips and Tricks for the Efficient Use of Arduino Programming Rating: 0 out of 5 stars0 ratingsGROKKING ALGORITHMS: A Comprehensive Beginner's Guide to Learn the Realms of Grokking Algorithms from A-Z Rating: 0 out of 5 stars0 ratingsCODING INTERVIEW: 50+ Tips and Tricks to Better Performance in Your Coding Interview Rating: 0 out of 5 stars0 ratingsGROKKING ALGORITHMS: Tips and Tricks of Grokking Functional Programming Rating: 0 out of 5 stars0 ratingsUX: A Comprehensive Beginner's Guide to Learn the UX Realms of UX Programming Rating: 0 out of 5 stars0 ratingsCODING INTERVIEW: Advanced Methods to Learn and Excel in Coding Interview Rating: 0 out of 5 stars0 ratingsUX: Tips And Tricks for Planning and Analyzing Data in UX Projects Rating: 0 out of 5 stars0 ratingsUX: Advanced Method and Actionable Solutions UX for Product Design Success Rating: 0 out of 5 stars0 ratingsARDUINO PROGRAMMING FOR BEGINNERS: Advanced Methods to Learn and Understand Arduino Hardware and Software Rating: 0 out of 5 stars0 ratingsUX: Simple and Effective Methods for Designing UX Great Products Using UX Programming Theories Rating: 0 out of 5 stars0 ratingsARDUINO PROGRAMMING FOR BEGINNERS: Simple and Effective Methods to Learn Arduino Programming Efficiently Rating: 0 out of 5 stars0 ratings
Related to GROKKING ALGORITHMS
Related ebooks
GROKKING ALGORITHMS: A Comprehensive Beginner's Guide to Learn the Realms of Grokking Algorithms from A-Z Rating: 0 out of 5 stars0 ratingsCODING INTERVIEWS: Advanced Guide to Help You Excel at Coding Interviews Rating: 0 out of 5 stars0 ratingsGROKKING ALGORITHMS: Tips and Tricks of Grokking Functional Programming Rating: 0 out of 5 stars0 ratingsProgramming Problems: A Primer for The Technical Interview Rating: 4 out of 5 stars4/5Ultimate Rust for Systems Programming Rating: 0 out of 5 stars0 ratingsLearning Go Programming: Build ScalableNext-Gen Web Application using Golang (English Edition) Rating: 0 out of 5 stars0 ratingsEssential Algorithms: A Practical Approach to Computer Algorithms Rating: 5 out of 5 stars5/5Algorithm Challenges: The Dojo Collection Rating: 0 out of 5 stars0 ratingsData Structure and Algorithms in Java: From Basics to Expert Proficiency Rating: 0 out of 5 stars0 ratingsData Structures and Algorithm Analysis in Java, Third Edition Rating: 4 out of 5 stars4/5Data Structures with Python: Get familiar with the common Data Structures and Algorithms in Python (English Edition) Rating: 0 out of 5 stars0 ratingsJava 9 Data Structures and Algorithms Rating: 0 out of 5 stars0 ratingsVisualizing Data Structures Rating: 0 out of 5 stars0 ratingsCode Your Way Up Rating: 5 out of 5 stars5/5CODING INTERVIEW: Advanced Methods to Learn and Excel in Coding Interview Rating: 0 out of 5 stars0 ratingsLearning PyTorch 2.0, Second Edition: Utilize PyTorch 2.3 and CUDA 12 to experiment neural networks and deep learning models Rating: 0 out of 5 stars0 ratingsMachine Learning For Beginners Guide Algorithms: Supervised & Unsupervsied Learning. Decision Tree & Random Forest Introduction Rating: 0 out of 5 stars0 ratingsUltimate Neural Network Programming with Python Rating: 0 out of 5 stars0 ratingsPyTorch Cookbook Rating: 0 out of 5 stars0 ratingsPython APIs: From Concept to Implementation Rating: 5 out of 5 stars5/5Tensorflow Machine Learning Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsProgramming Problems: Advanced Algorithms Rating: 4 out of 5 stars4/5Node.js Design Patterns Rating: 4 out of 5 stars4/5Golang Mini Reference: A Hitchhiker's Guide to the Modern Programming Languages, #1 Rating: 0 out of 5 stars0 ratings
Programming For You
SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Python: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5JavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5PYTHON PROGRAMMING Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Microsoft Azure For Dummies Rating: 0 out of 5 stars0 ratingsAlgorithms For Dummies Rating: 4 out of 5 stars4/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Python for Data Science For Dummies Rating: 0 out of 5 stars0 ratingsBeginning Programming with C++ For Dummies Rating: 4 out of 5 stars4/5Python Games from Zero to Proficiency (Beginner): Python Games From Zero to Proficiency, #1 Rating: 0 out of 5 stars0 ratings
Reviews for GROKKING ALGORITHMS
0 ratings0 reviews
Book preview
GROKKING ALGORITHMS - Eric Schmidt
Introduction
Welcome to Grokking Algorithms: Advanced Methods to learn and use Grokking Algorithms and Data structures for Programming.
Even before the conception of the computer itself, algorithms existed. After the computer was introduced and with all the development that followed, the number of existing algorithms grew increasingly. At this stage, it wouldn't be wrong to say that algorithms are the core of what computing today is capable of.
Grokking Algorithms provides a very comprehensive and interesting introduction to the world of computer algorithms. We will look at a lot of algorithms and their uses, and we'll even learn how to manipulate them step by step. Even though the book is aimed at an audience with a more advanced level of knowledge, we have tried to convey most of the explanations and knowledge contained within the book in an easygoing manner to make it easier to understand.
We have discussed multiple algorithms and data structures throughout the book. The algorithms are laid out in pseudocode (which is more similar to English than programming) and can be read by anyone with a basic programming knowledge level.
Finally, we'd like to thank you for choosing Advanced Methods to learn and use Grokking Algorithms and Data structures for Programming, and we welcome you to Grokking Algorithms!
Chapter 1
An Introduction to the Basics
Do you remember what the original computer was originally intended for? The modern-day digital computer we see today was invented to simplify complex computations. With the computer, time-consuming and complex computations were facilitated and sped up, drastically reducing the immense manpower and resources allocated.
Now, what sort of computations, you might wonder, and it isn't uncommon for that question to occur. After all, modern-day computers, in usage, are more inclined towards the manipulation of information rather than computation. For example, computers today are more popular for their ability to store large wads of information. However, the ability to store information wouldn't be all that useful without the ability to access the said information at will, any time you want.
With this combination of storing and retrieving data, the system's computation part, which it was originally intended for (like arithmetic calculations, etc.), has become irrelevant for the most part. You might be wondering, what does all of this have to do with the topic at hand, data structures? Well, let's find out.
All the information we've disclosed up to this point has had two main reasons:
To define what the term data will refer to in the book. Data, by definition, can have multiple meanings according to its context. In this book, whenever we utilize or refer to the term data, we're referring to any type of information that your machine or computer (to be specific) is currently storing or manipulating. These points need to be elaborated on because many seasoned developers often refer to data as information that has already been processed. That is simply too narrow for our use throughout the book.
To give you an introduction to data structures and where they stem from, which is something we'll jump onto next.
What Are Data Structures?
Data structures are simply a method of storing and utilizing all the different types of data. Better yet, you can think of them as not storing. Rather, a much better explanation would be to say that data structures are used to organize data.
However, that isn't all data structures are capable of doing. As the world continues to progress on the path of development, the importance of data continues to increase, too, and along with it, so does the significance of data structures.
Data structures are vital in identifying the type of data present and also help to find specific data from other data. Furthermore, they also highlight the relationship that all the different types of data within the structure have with each other.
Now, it might be a little hard for you to understand at this point, so let's take an example. Can you think of different types of footwear? Men or women’s wear doesn't matter, but they have to be of different types, for example, joggers, slippers, etc. You can arrange these footwears alternatively; take a look at the illustration below:
J S J S
The illustration above replaces joggers with the letter J, whereas slippers are substituted with the letter S.
Now, you can classify each footwear representation, which in this case would be a single letter (for example, the J for jogger), as a unit of data. If, for any reason, you want to maintain the same arrangement for all of the data to come (that is, alternative placement of joggers and slippers), you would have to refer to or employ which would manipulate the data by identifying and ordering the footwear.
With that being said, a data structure can provide multiple mechanisms that help manipulate and organize data. For instance, if we were to continue the example above, another arrangement could include:
J S S J
That isn't all; data structures can also help assign identifiers to the footwear in the example above. For instance:
J S J S
0 1 2 3
Continuing the example above, assigning a numerical identifier would look something like this. You should remember that, since we're simply on the basics at the moment, assigning a numerical identifier would be irrelevant to the type of footwear it is assigned to. You'll be able to witness this from the example above; even though the type of footwear on index number 0 and index number 2 are the same (both are joggers), they have been assigned different index numbers.
Therefore, if you were to try to call any of these footwears, you'd have to refer to them by their assigned identifier. For instance, if you wanted to have the first slipper, you'd have to call the slipper on index number 1 to get it; simply stating the slipper would be too vague!
And that's all, folks! We're not kidding. That really is all! As elementary as all of the knowledge above might seem, that is all data structures do. While the types of data structures and how they manipulate and store data continue to grow more and more complex, if we're talking about a simple introduction to the concept of data structures, that's all you need to know at the moment. And no need to worry. It's not like we won't delve into some of the more advanced data structures and the complex relationships of their data later on.
If you're still unclear about what a data structure stands for, you can reread the lesson again (just in case you missed out on something). However, this time, reread the subtopic while keeping in mind that data structures are simply containers that are meant for data, and you'll be able to understand some of the concepts in the lesson much more easily.
What Are Algorithms?
To put it bluntly, an algorithm is a sequence or order of steps intended to solve a problem. This sequence must be followed in the correct order and will always work to the problem that it was initially designed to solve. Now, you might think that any solution that is not designed with a sequence of steps might not be an algorithm, and voila! You're right on the mark. An algorithm is a method of solving problems by dividing the intended solution into steps to follow easily.
A simpler way of understanding an algorithm would be to think of it as a problem-solving technique that solves its problems in an ordered sequence. You can even shorten the definition to a single word: an algorithm is simply a procedure. (You might think of it as unnecessary to spend so much time on the definition, but not everyone would have understood if we'd just started by saying it is a procedure!). Many people, from professionals to newbies who have just started out programming, have varying ideas of what an algorithm actually is. If you're a reader of this book, it will be enough for you to get by any of the three definitions that we've stated above, as long as you understand.
However, no matter how much the definition may vary from individual to individual, everyone, newbies and professionals alike, agree that algorithms comprise logical steps to accomplish a set task. To achieve success with the said task (which can be anything at this point), it simply isn't enough to have logical and orderly steps. If you want your sequence to classify as a good algorithm, these logical steps must be precise, simple, and unambiguous. Simply speaking, they shouldn't be fluffed out and give a simple yet straightforward solution to a problem.
However, this is, once again, subject to each individual's taste. Some programmers tend to make needlessly complex algorithms by using esoteric features present in many programming languages to make their algorithms hard to decipher. However, you should understand that making an algorithm easy to understand is a good practice, and the easier it is for