answersLogoWhite

0

for the most part, programming is writing algorithms. An algorithm is just a sequence of instructions designed to get a desired result.

lets write an algorithm for finding the largest number in a list of numbers:

You have a list called numberList and it has a bunch of random numbers stored in it. The only way you can find the largest number is if you go through every element in numberList. Since we don't know anything about any of the numbers in numberList (they could all be the same) lets just call the first element in the list our currentLargest. As we traverse through numberList, if we come across a number larger than our currentLargest then we assign the new number as our currentLargest. Once we have looked at every element in the numberList, our currentLargest should be the largest number in numberList.

The code for the above program would look something like this [Pseudocode]:

numberList = {1, 39, 8, 109, ...}

currentLarget = numberList0

FOR every element in numberList

. . . IF element > currentLargest

. . . . . . currentLargest = element

PRINT currentLargest

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is writing Code?

Writing code is the process of implementing an algorithm in a specific programming language.


What are the main steps involved in writing algorithm?

1 Define the problem 2 Analyze the problem 3 Develop an algorithm/method of solution 4 Write a computer program corresponding to the algorithm 5 Test and debug the program 6 Document the program (how it works and how to use it)


What are the release dates for The Algorithm - 2013?

The Algorithm - 2013 was released on: USA: 5 April 2013


What are the ways representing an algorithm?

You can represent an algorithm by three different ways: 1. Pseudo Code 2. Structured flow charts 3. Actual code


How can you approach writing an algorithm to solve a specific problem efficiently?

To approach writing an algorithm efficiently, start by clearly defining the problem and understanding its requirements. Then, break down the problem into smaller, manageable steps. Choose appropriate data structures and algorithms that best fit the problem. Consider the time and space complexity of your algorithm and optimize it as needed. Test and debug your algorithm to ensure it works correctly.


How do you write algorith of C programs?

There is no specific Hard and Fast rule for writing algorithm. The normal method is the following: 1. get a problem 2. find or invent an algorithm to solve it 3. implement the algorithm in a programming language (C, for example)


What is the algorithm for multiplying fractions?

2 + 2 x 5 x 6 x 8 x 7 is the algorithm for that


Algorithm A completes 3 cycles in one minute. Each of Algorithm B and Algorithm C respectively completes 4 and 5?

The full Question...Suppose 3 algorithms are used to perform the same task for a certain number of cycles. Algorithm A completes 3 cycles in one minute. Each of Algorithm B and Algorithm C respectively completes 4 and 5 cycles per minute. What is the shortest time required for each Algorithm to complete the same number of cycles?


What is difference between alogrithm and pseudo code?

An algorithm is an abstract set of rules used to solve a specific problem. Pseudocode is just one of many ways to represent an algorithm.


What is the process involved in developing a currency conversion algorithm?

Developing a currency conversion algorithm involves gathering exchange rate data, determining the input and output formats, writing code to calculate the conversion, testing the algorithm with different currencies, and refining it based on feedback.


Why should you develop a detailed algorithm for a program before writing down any assembly language instructions?

Because fuuck you !!


What are the ways of writing a number?

alphabetically