Introduction to
Algorithms &
Data Structures 1
A solid foundation for the real world of machine learning and data analytics
Bolakale Aremu
Ojula Technology Innovations
___________________
___________________
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third-party content may be suppressed. Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous editions, changes to current editions, and alternate formats, please contact and inquire ISBN number, author, or title for materials in your areas of interest.
Introduction to Algorithms & Data Structures
First Edition
2023 Ojula Technology Innovations
ISBN: 9791222093178
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented.
Ojula Technology Innovations is a leading provider of customized learning solutions with employees residing in nearly 45 different countries and sales in more than 130 countries around the world. For more information, please contact .
Printed in the United States of America
Print Number: 01
Print Year: April 2023
I am indebted to my mother for her love, understanding and support throughout the time of writing this textbook.
Bolakale Aremu
Table of Contents
About The Author
My name is Bolakale Aremu. My educational background is in software development. I have a few colleagues who are software developers and system engineers. I spent over 17 years as a software developer, and Ive done a bunch of other things too. I've been involved in SDLC/process, data science, operating system security and architecture, and many more. My most recent project is serverless computing where I simplify the building and running of distributed systems. I always use a practical approach in my projects and courses.
Bolakale Aremu
CEO, Ojula Technology Innovations
Web developer and Software Engineer
Ojulaweb.com
0. What You Will Learn & How to Get Help
The design of an efficient algorithm for the solution of the problem calls for the inclusion of appropriate data structures. In the field of computer science, data structures are used to store and organize data in a way that is easy to understand and use. They are used to organize and represent data in a way that will make it easier for computers to retrieve and analyze it. These are the fundamental building blocks that any programmer must know how to use correctly in order to build their own programs.
0.1. Benefits of learning aboutalgorithms and data structures
First, they will help you become a better programmer. Another benefit is that they will make you think more logically. Furthermore, they can help you design better systems for storing and processing data. They also serve as a tool for optimization and problem-solving.
As a result, the concepts of algorithms and data structures are very valuable in any field. For example, you can use them when building a web app or writing software for other devices. You can apply them to machine learning and data analytics, which are two hot areas right now. If you are a hacker, algorithms and data structures in Python are also important for you everywhere.
Now, whatever your preferred learning style, I've got you covered. If you're a visual learner, you'll love my clear diagrams and illustrations throughout this book. If you're a practical learner, you'll love my hands-on lessons so that you can get practical with algorithms and data structures and learn in a hands-on way.
0.2. Course Structure
There are three volumes in this course. This is volume one. In this volume, you'll take a deep dive into the world of algorithms. With increasing frequency, algorithms are starting to shape our lives in many ways - from the products recommended to us, to the friends we interact with on social media, to even important social issues like policing, privacy and healthcare. So, the first part of this course covers what algorithms are, how they work, and where they can be found (real life applications).
In the second volume, you'll work through an introduction to data structures. You're going to learn about two introductory data structures - arrays and linked lists. You'll look at common operations and how the runtimes of these operations affect our everyday code.
In the third volume, you're going to bring your knowledge of algorithms and data structures together to solve the problem of sorting data using the Merge Sort algorithm. We will look at algorithms in two categories: sorting and searching. You'll implement well-known sorting algorithms like Selection Sort, Quicksort, and Merge Sort. You'll also learn basic search algorithms like Sequential Search and Binary Search.
At the end of many sections of this course, short practice exercises are provided to test your understanding of the topic discussed. Answers are also provided so you can check how well you have performed in each section. At the end of the course, you will find a link to download more helpful resources, such as codes and screenshots used in this book, and more practice exercises. You can use them for quick references and revision as well. My support link is also provided so you to contact me any time if you have questions or need further help.
By the end of this course, you will understand what algorithms and data structures are, how they are measured and evaluated, and how they are used to solve real-life problems. So, everything you need is right here in this book. I really hope youll enjoy it. Are you ready? Let's dive in!
1. Introduction to Algorithms
Whether you are a high school or college student, a developer in the industry or someone who is learning to code, you have undoubtedly run into the term algorithm. For many people, this word is kind of scary. It represents this body of knowledge that seems just out of reach. Only people with computer science degrees know about algorithms.
Now to others, this brings up feelings of imposter syndrome. You might already know how to code, but you're not a real developer because you don't know anything about algorithms. It makes some developers frame certain jobs as above their skill level because the interview contained algorithm questions. Well, whatever your reasons are, in this course, our goal is to dispel all those feelings and get you comfortable with the basics of algorithms. Like any other subject, I like to start my courses with what the course is and what is not.
In this part of the course, we're going to cover the very basic set of knowledge that you need as a foundation for learning about algorithms. This part is less about specific algorithms and more about the tools you will need to evaluate algorithms, understand how they perform, compare them to each other, and make a statement about the utility of an algorithm in a given context.
Next page