






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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An introduction to algorithms, pseudocode, and developing an application using Python programming language. It explains the divide and conquer algorithm, recursion, and the process of creating an application. It also discusses the importance of formulating requirements, precise specifications, creating a design, coding, testing the program, and maintenance. useful for computer science students who want to learn about algorithms and programming languages.
Typology: Assignments
1 / 11
This page cannot be seen from the preview
Don't miss anything!
If one of the list runs out of elements, we will add in the merged list the rest of the elements from the other list. Fig 1.2 – Merge-sort algorithm flowchart Now, suppose we have an unordered list. To sort it, we can use divide-and-conquer algorithm:
These steps look easy enough. The main problem is, how we can sort the two halves? The solution is to create a function that will call by itself (basically halving the list on and on) until the list will have only one single element (which will be sorted). This is called recursion!!! Fig 1.2.1 – Divide and conquer – sorting flowchart
The computer can only do exactly what the program tells the computer to do. The process for creating an application is often broken down into stages:
solve it.
your program will work. Describing the inputs and outputs used in the program, specifying the relationship between them.
program. Design the algorithm that will meet the criteria in specifications.
it into the computer.
errors (bugs), they should be fixed before going further. When you try to fix the errors is called debugging.
programs are evolving over the years.
A programming language represents the code to write down the instructions which computers can follow. The process of writing an algorithm in a programming language is called coding. With the help of the programming languages, we can write code than is easier for humans to understand. Programming languages have a precise form (syntax) and a precise meaning (semantics). The language that computer ‘speak’ is called binary. Being very difficult for humans to read/write in binary, an intermediate language had to be developed to translate in binary our code – this is the interpreter. Python is a object-oriented programming language, widely-used, with dynamic semantics, used for general-purpose programming. It was created by Guido van Rossum, and first released on February 20, 1991. When a programmer is using a high-level language to develop programs (python for example), the computer needs to understand the code – the interpreter – interprets the code into bytes. So, the programmer generates source code and the interpreter generates object code ( P-Code, binary code or machine code) (Zelle, 2002). Fig. 4 – Basic program flowchart
A compiler reads the program and translates it completely before the program starts running. To generate object code from source code, there are two different techniques used
The Euclidean algorithm is one of the fastest way of finding the GCD on any large integer!!!
Anon., n.d. Intro to algorithms. [Online] Available at: https://www.khanacademy.org/computing/computer-science/algorithms/intro-to- algorithms/v/what-are-algorithms [Accessed 18 10 2021]. Downey, A. B., 2009. PYTHON FOR SOFTWARE DESIGN. New York: Cambridge University Press. Gauld, A., 2006. Learning to program. s.l.:Addison-Wesley Professional. Sweigart, A., 2015. Cracking codes with python. San Francisco: William Pollock. Zelle, J. M., 2002. Python Programming: An Introduction to Computer Science. 1st ed. s.l.: Wartburg College.