Algorithms_1.pdf - Data structures and Algorithms Algorithms Definition • What is an Algorithm • Informally an algorithm is any well-defined

Algorithms_1.pdf - Data structures and Algorithms...

This preview shows page 1 - 7 out of 20 pages.

Data structures and Algorithms Algorithms
Image of page 1

Subscribe to view the full document.

Definition What is an Algorithm Informally an algorithm is any well-defined computational procedure that takes some value or set of values as input and produces some value or set of values as output. An algorithm is thus a sequence of computational steps that transform the input into the output. You can also view an algorithm as a tool for solving a well-specified computational problem.
Image of page 2
Definition An algorithm is a set of well-defined steps required to accomplish some task. Algorithms also usually involve taking a system from one state to another, possibly transitioning through a series of intermediate states along the way.
Image of page 3

Subscribe to view the full document.

Algorithms Look at the problem : we need to sort a sequence of numbers into non deceasing order. Input: A sequence of n numbers (a1, a2, …….an) Output: A permutation (reordering ) {a 1 1, a 1 2, a 1 3…… a 1 n} of the input sequence such that a 1 1<= a 1 2 <= a 1 3……<= a 1 n For example given the input sequence {31, 41, 59, 26, 41 58} a sorting algorithm returns as output the sequence {26, 31, 41, 58, 59}
Image of page 4
Algorithms An algorithm is said to be correct if for every input instance it halts with the correct output An algorithm can be specified in English as a computer program or even as a hardware design The only requirement is that the specification must provide a precise description of the computational procedure to be followed .
Image of page 5

Subscribe to view the full document.

Algorithms Practical applications The internet enables people around the world
Image of page 6
Image of page 7
  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes