Luciano Manelli
Taranto, Italy
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/9781484256220 . For more detailed information, please visit www.apress.com/source-code .
ISBN 978-1-4842-5622-0 e-ISBN 978-1-4842-5623-7
https://doi.org/10.1007/978-1-4842-5623-7
Luciano Manelli 2020
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY 10004, U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Introduction
This book serves as a starting point for anyone who is beginning their study of computer science and information systems. Algorithms play an important role in programming, and they can be considered the cornerstone of computer science, because computer programs would not exist without algorithms. In fact, understanding a problem and getting a solution is a fundamental condition for software development and problem-solving strategies. Therefore, the aim of this book is to explain algorithms in different ways and then teach you how to analyze new algorithms. In this book, we will use the C language to verify the correctness of the algorithms.
Chapterdefines the algorithms and flowcharts with graphical and textual explanations. Well look at simple and complex standard algorithms, as well as their flowcharts. Everything is integrated with explanations, schemas, and tables to show the step-by-step evolution of the algorithms.
The main analyzed algorithms are the following: the sum of three ornnumbers in a loop, the decimal to binary conversion, the maximum and minimum search, the linear/sequential search, the binary search, the bubble sort, the selection sort, the merging of two sorted arrays, and the reading chars from file algorithm, stack management, and the recursive algorithm (factorial and Fibonacci sequence).
The last chapter is devoted to the introduction of the C language and the implementation of code related to the algorithms in this book. Many C programs are explained.