Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
C# and Algorithmic Thinking for the Complete Beginner

You're reading from  C# and Algorithmic Thinking for the Complete Beginner

Product type Book
Published in Jun 2024
Publisher Packt
ISBN-13 9781836205630
Pages 916 pages
Edition 1st Edition
Languages
Author (1):
Aristides Bouras Aristides Bouras
Profile icon Aristides Bouras
Toc

Table of Contents (11) Chapters close

Preface 1. Part I Introductory Knowledge 2. Part II Getting Started with C# 3. Part III Sequence Control Structures 4. Part IV Decision Control Structures 5. Part V Loop Control Structures 6. Part VI Data Structures in C# 7. Part VII Subprograms 8. Part VIII Object-Oriented Programming 9. Part IX Files 10. Some Final Words from the Author

Chapter 4
Introduction to Basic Algorithmic Concepts

4.1 What is an Algorithm?

In technical terms, an algorithm[1] is a strictly defined finite sequence of well-defined statements (often called instructions or commands) that provides the solution to a problem or to a specific class of problems for any acceptable set of input values (if there are any inputs). In other words, an algorithm is a step-by-step procedure to solve a given problem. The term finite means that the algorithm must reach an end point and cannot run forever.

You can find algorithms everywhere in your real life, not just in computer science. For instance, the process of preparing toast or a cup of tea can be expressed as an algorithm. Certain steps, in a particular order, must be followed to achieve your goal.

4.2 The Algorithm for Making a Cup of Tea

The following is an algorithm for making a cup of tea.

1)Put a teabag in a cup.
2)Fill a kettle with water.
3)Boil the water in the kettle.
4)Pour some of the boiled water...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime