







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to algorithms, their properties, and examples. It covers the definition of algorithms, their importance, and various types of algorithms. The document also includes a step-by-step example of an algorithm to find the second largest value in an array using C# programming language.
Typology: Cheat Sheet
1 / 13
This page cannot be seen from the preview
Don't miss anything!








Grade: Assessor Signature: Date: Signature & Date:
Student Name/ID Number: Nguyen Thuy My/GCS Unit Number and Title: Unit 1: Programming Academic Year: 2021 – 2022 Unit Assessor: Phan Minh Tam Assignment Title: Problem solving with algorithms Issue Date: 27 September 2021 Submission Date: Internal Verifier Name: Date: Submission Format: Format: ● The submission is in the form of an individual written report. This should be written in a concise, formal business style using single spacing and font size 12. You are required to make use of headings, paragraphs and subsections as appropriate, and all work must be supported with research and referenced using the Harvard referencing system. Please also provide a bibliography using the Harvard referencing system. Submission ● Students are compulsory to submit the assignment in due date and in a way requested by the Tutor. ● The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/. ● Remember to convert the word file into PDF file before the submission on CMS. Note:
what an algorithm is and outline the process in building an application. from writing code to execution. implementation of an algorithm in a suitable language. Evaluate the relationship between the written algorithm and the code variant.
Table of Contents
1.2. Algorithm properties An algorithm would consist of the following components: Accuracy: It is the most critical component in achieving successful outcomes and operations. Clarification: The method is based on the commands. As a result, the algorithm should be presented in a clear, easy-to-understand manner and in a certain order. Universality: The algorithm must be very applicable. It is utilized to solve a wide range of issues, not just specific ones. Objectivity: The algorithm, no matter how it is implemented, always yields only one answer. If there is a different answer from the person who implements the algorithm or the computer, it should be reconsidered Termination: Because an algorithm is a finite set, it always has an endpoint, as shown in the What is an algorithm section. When a match is discovered, this is interpreted as the endpoint. 1.3. Some Algorithms There are many algorithms, such as: For almost any kind of math problem to solve Numerical algorithms. Algebraic algorithms. Geometric algorithms. Sequential algorithms. Operational algorithms. Theoretical algorithms. Various algorithms are named after the top mathematicians who invented them Shor’s algorithm. Girvan-Newman algorithm. P a g e | 2
Several Euclidian algorithms. Algorithms are named after the specific problem they solve Bidirectional search algorithm. K-way merge algorithm. 1.4. Example of algorithms “Find the second largest value of 10 interger numbers entered from the keyboard” To implement the algorithm and produce its results, we have: Input: 10 integers entered from the keyboard Output: the second value of the sequence Algorithm solving process: After solving the above algorithm, the result of the main algorithm is MAX P a g e | 3
STEP 2: Decalera MAX = 0, Array B[10] STEP 3: Set variable i = 0 STEP 4: for i < length of array B, repeat STEP 5 STEP 5: Read B [i] STEP 6: if N[i] > MAX is true then STEP 6.1: Set MAX= B[i] STEP 8: Read MAX STEP 9: Decalera MAX2 = 0 STEP 10: for i < length of array B, repeat STEP 5 STEP 11: Read B[i] STEP 12: if B[i] > MAX2 and B[i] < MAX is true then STEP 12.1: Set MAX2 = B[i] Step 13: Print MAX STEP 14: STOP
Techopedia. Some algorithsm. [Online] Available at: https://www.techopedia.com/definition/3739/algorithm http://www.mms.com/ [Accessed 28 September. 2021] WhatIs.Techtarget. Definition of algorithms. [Online] Available at: https://whatis.techtarget.com/definition/algorithm [Accessed 28 September. 2021] P a g e | 5