Back To Course

Business 109: Intro to Computing10 chapters | 84 lessons | 9 flashcard sets

Are you a student or a teacher?

Try Study.com, risk-free

As a member, you'll also get unlimited access to over 75,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.

Try it risk-freeWhat teachers are saying about Study.com

Already registered? Login here for access

Your next lesson will play in
10 seconds

Lesson Transcript

Instructor:
*Paul Zandbergen*

Paul has a PhD from the University of British Columbia and has taught Geographic Information Systems, statistics and computer programming for 15 years.

Modern computers can carry out very complex tasks. Each task consists of well-defined procedures known as algorithms. Learn how computers use algorithms to perform the tasks we expect them to do.

Consider how you use a computer in a typical day. For example, you start working on a report, and once you have completed a paragraph, you perform a spell check. You open up a spreadsheet application to do some financial projections to see if you can afford a new car loan. You use a web browser to search online for a kind of car you want to buy.

You may not think about this very consciously, but all of these operations performed by your computer consist of algorithms. An **algorithm** is a well-defined procedure that allows a computer to solve a problem. Another way to describe an algorithm is a sequence of unambiguous instructions. The use of the term 'unambiguous' indicates that there is no room for subjective interpretation. Every time you ask your computer to carry out the same algorithm, it will do it in exactly the same manner with the exact same result.

Consider the earlier examples again. Spell checking uses algorithms. Financial calculations use algorithms. A search engine uses algorithms. In fact, it is difficult to think of a task performed by your computer that does not use algorithms.

Let's take a closer look at an example.

A very simple example of an algorithm would be to find the largest number in an unsorted list of numbers. If you were given a list of five different numbers, you would have this figured out in no time, no computer needed. Now, how about five million different numbers? Clearly, you are going to need a computer to do this, and a computer needs an algorithm.

Below is what the algorithm could look like. Let's say the input consists of a list of numbers, and this list is called L. The number L1 would be the first number in the list, L2 the second number, etc. And we know the list is not sorted - otherwise, the answer would be really easy. So, the input to the algorithm is a list of numbers, and the output should be the largest number in the list.

The algorithm would look something like this:

Step 1: Let Largest = L1

This means you start by assuming that the first number is the largest number.

Step 2: For each item in the list:

This means you will go through the list of numbers one by one.

Step 3: If the itemLargest:If you find a new largest number, move to step four. If not, go back to step two, which means you move on to the next number in the list.

Step 4: Then Largest = the item

This replaces the old largest number with the new largest number you just found. Once this is completed, return to step two until there are no more numbers left in the list.

Step 5: Return Largest

This produces the desired result.

Notice that the algorithm is described as a series of logical steps in a language that is easily understood. For a computer to actually use these instructions, they need to be written in a language that a computer can understand, known as a **programming language**.

There are many different types of algorithms. Search algorithms are used to find an item with specific properties among a collection of items. For example, you may want to know if a particular word occurs in a list of words or not. Searching is closely related to the concept of dictionaries since it is like looking up a word in a dictionary. There are different approaches to searching, each representing a slightly different technical approach to the same problem.

In a sequential or linear search, you start by examining the first item in the list to see if it matches the properties you are looking for. If not, you continue examining each sequential item until a match is found.

This approach will produce the correct result, but it is not very efficient. For a relatively small list that only needs to be searched once, it may not matter much if the search takes a little longer. However, many computer tasks require not just one, but hundreds, of algorithms to be run. The datasets can also be very large and may need to be processed repetitively. As a result, processing speed matters.

Alternative algorithms may require less time to find the correct answer. This is known as optimization: the process of finding the most computationally efficient algorithms to solve a particular problem.

In the case of searching, an alternative to sequential search is the binary search. A binary search improves the algorithm by removing as much of the input data as possible without having to examine each item. Let's say you are looking for a particular number in a list of numbers, and the list is already sorted. This presents an opportunity to search faster.

In a binary search, you would jump to the item more or less in the middle of the list. If the number you are looking for is higher, you can drop the left-hand side of the list and continue only with the right-hand side. That reduces the number of items to search through by half in just one step. You can repeat this until you have found the number you are looking for or until the remaining list is very short, and then you can run a sequential search very quickly.

There are many alternative search algorithms, each with their own strengths and weaknesses. A good algorithm is one that produces the correct answer and is computationally efficient. Computer enthusiasts spend much of their time developing better algorithms.

Determining which algorithm is best for a given task is not as easy as it may sound. For example, in the case of sequential and binary search, the binary search is much faster but only if the list of interest is already sorted. Sorting would require another algorithm, which will take quite a bit of time. This may be worth it if the list will be searched many times. However, if you only plan to search an unsorted list once, the sequential search will be faster than first performing a sort and then a binary search.

Tasks performed by computers consist of algorithms. An **algorithm** is a well-defined procedure that allows a computer to solve a problem. A particular problem can typically be solved by more than one algorithm. Optimization is the process of finding the most efficient algorithm for a given task. A good algorithm is one that produces the correct answer and is computationally efficient.

After this lesson, you should be able to:

- Define algorithm and explain how an algorithm works
- Describe the process of optimization
- Identify some of the different types of algorithms

To unlock this lesson you must be a Study.com Member.

Create your account

Are you a student or a teacher?

Already a member? Log In

BackWhat teachers are saying about Study.com

Already registered? Login here for access

Did you know… We have over 160 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

You are viewing lesson
Lesson
8 in chapter 9 of the course:

Back To Course

Business 109: Intro to Computing10 chapters | 84 lessons | 9 flashcard sets

- 5 Basic Elements Of Programming 9:16
- What Is Programming? - Definition & Introduction for Beginning Programmers 3:47
- Object-Oriented Programming vs. Procedural Programming 7:17
- Functional Programming and Procedural Programming 6:58
- Using Pseudocode to Map Code 6:16
- Pseudocode: Definition & Examples 5:52
- Boolean Logic, Operators & Expressions 6:56
- What is a Computer Algorithm? - Design, Examples & Optimization 7:49
- Go to Programming Methodology

- Introduction to HTML & CSS
- Introduction to JavaScript
- Computer Science 332: Cybersecurity Policies and Management
- Introduction to SQL
- Computer Science 203: Defensive Security
- JavaScript Language Basics
- JavaScript & HTML
- Error Handling, Debugging & Events in JavaScript
- HTML Elements & Lists
- Conditionals, Arrays & Loops in JavaScript
- Anti-Bullying Survey Finds Teachers Lack the Support They Need
- What is the ASCP Exam?
- ASCPI vs ASCP
- MEGA Exam Registration Information
- MEGA & MoGEA Prep Product Comparison
- PERT Prep Product Comparison
- MTLE Prep Product Comparison

- Students with ADHD
- Tools & Weapons of the Neolithic Age
- Communication to Foster Childhood Development
- Mandalas: History & Examples
- ISO/IEC 27004: History & Overview
- KPIs: Strategic, Risk Management & Operational Security
- FOIL Method Lesson Plan
- Quiz & Worksheet - Cauchy-Riemann Equations
- Quiz & Worksheet - Teacher-Student Interactions in Preschool
- Worksheet & Practice - Graphing Trig Functions
- Quiz & Worksheet - Rural Settlement Patterns
- Flashcards - Measurement & Experimental Design
- Flashcards - Stars & Celestial Bodies
- What is STEM Education?
- Trigonometry Worksheets

- High School Physical Science: Help and Review
- 5th Grade Math: Practice & Review
- High School Psychology: Credit Recovery
- US History: Credit Recovery
- AP English Literature: Tutoring Solution
- Civil Rights - ORELA Middle Grades Social Science
- MTTC Integrated Science (Elementary): Magnetism
- Quiz & Worksheet - Nonverbal Communication in Business
- Quiz & Worksheet - Environmental Effects of Textile Manufacturing
- Quiz & Worksheet - Target Costing
- Quiz & Worksheet - Delphi Technique
- Quiz & Worksheet - Spanish Practice for Doubt & Negation

- What is Color Theory? - Definition, Basics & Examples
- Theseus & the Minotaur: Lesson for Kids
- Getting Started with Study.com's College Courses: Student Tour
- The New SAT vs. the Old SAT
- Study.com's Virtual Classrooms
- Easiest Ways to Learn French
- Spelling Activities for Kids
- How to Learn French Quickly
- How Much Does It Cost to Homeschool?
- What is the International Baccalaureate?
- 8th Grade Math Games
- CHPN Certification Requirements

- Tech and Engineering - Videos
- Tech and Engineering - Quizzes
- Tech and Engineering - Questions & Answers

Browse by subject