






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 in-depth exploration of algorithms and programming paradigms. It covers various types of algorithms such as basic, probabilistic, heuristic, and approximate algorithms. The document also discusses algorithm methodology, the difference between algorithms and code, and the implementation of algorithms. Furthermore, it introduces the reader to different programming paradigms including procedural, event-driven, and object-oriented paradigms. Students will find this document useful for understanding the theoretical concepts behind algorithms and programming paradigms.
Typology: Essays (high school)
1 / 11
This page cannot be seen from the preview
Don't miss anything!







understand. Once we understand what is actually required from us, only then can we devise optimal solutions for it.
In the field of computer science, there are numerous algorithms which are in use in different domains. All problems have their own algorithms thus there is a wide range of machine learning algorithms networking algorithms, searching algorithms etc. however all these algorithms are a part of three distinct categories and are further classified from there. The three major categories of algorithms that are used in computer science are
These are the type of pf algorithms where we can obtain results-based probability or in other words chances (R & K 2011). These algorithms generate random results and we do not have any pre-hand notion what the answer will be in these cases. It is for this reason that these algorithms are also sometimes referred to as randomized algorithms.
These algorithms come handy when we are aiming to reduce the overall time complexities of our codes. They generate randomized results which can often help in lowering the overall complexities for our
There are random numbers generated which help to decide the next steps of these algorithms. The entire logic of such programs depends upon probability and randomly generated numbers. As an example of such algorithms, we have lottery scheduling algorithm, we have randomized quick sort where on the basis of randomly generated numbers, the next outputs are determined.
These algorithms aim at finding the most optimal solution when all classic methods are unable to come to any solid solution. These algorithms don’t give us the mot accurate (to the point answers) rather they work on finding the most nearing possible solution which are good or almost near to good (Van & K 1991).
These algorithms ae useful in cases where we are not entirely sure what to search for, so all the relevant nearby possibilities are check so as to find the most relevant answer.
These algorithms are also approximate algorithms, but they make approximations in a way that the results rather than being random, are highly close to the origan results (Brown 2008). A common example of such algorithms are the antivirus programs that have been implemented in our computer systems.
The third type of algorithms that are commonly used in computer systems are known as approximate algorithms. These algorithms let us find very guaranteed solution to all approximation problems and we can be sure that the answer we are achieving is going to be accurate (Brown 2008). With the implementation of these algorithms, we aim to get the most optimal results in the least time.
The goal is to come as close as possible to the correct answer in linear time.
An example of such algorithms is the vertex finding algorithms where the minimum vertex in graphs is found out in the minimum time possible.
Algorithms are not just any random sequence of steps and must be planned out in a proper manner. They must be developed following certain criteria so that we are able to achieve our results. There are certain expectations we always expect the algorithms to possess. These are very important for the proper working of the algorithm and ultimately the developed programs. Here we list the important characteristics of the programs:
algorithm, then it becomes easy to implement it irrespective of any language. There are many test beds available on the internet so once we have prepared the algorithm, we must test its practical application by providing it value from the test beds to confirm the accurate working.
Procedural programming as the name indicates is the type of programming approach where there are a set of procedures. This technique of programming is the most commonly used ones and is derived from the techniques of structural programming. The basic concept here is that of functions or procedures which are invoked when needed be. These functions contain a block of code that corresponds to a specific task. When the programs are executing in a top to bottom flow, these routines can be invoked at any point by simply calling them out. The call is made by writing out the function name and passing it the required parameters (optional). Functions can also call out other functions and in this way the
objects hold data as attributes and the snippets are stored in the form of methods. The main idea behind OOP or object-oriented programming is to map the real-life happenings onto the code.
There are many important characteristics of OOP which make it widely used. These include the division of our codes into classes and objects which helps us to separate our codes from each other. We can create simple instances of the classes as many times as needed which helps us to better understand the underlying concepts. Another important aspect of OOP programming is that here the bottom-up approach is followed. Another major benefit offered by OOP techniques is that this programming paradigm offers a lot of ways to protect data by the usage of various access modifiers. We can decide whether to restrict or allow the data access making our codes safer. It is due to this data hiding that OOP becomes a very safe choice for implementation.
we have been provided with three different codes which all of which correspond to a calculator application. The codes have been written in three different styles i.e., procedural, event driven and object-oriented manner. There is a clear distinction between them as we see that the calculator app designed using procedural approach simply follows a top to bottom approach as the inputs are checked sequentially in the switch statement until the input matches the set cases. In the object-oriented approach, we see that there is clear use of classes and objects. A main calculator class has been constructed which contains various methods involved in the calculators. Then we have a driver class which contains the menu for the code. And lastly, we have the main body from where the code execution starts. Thus, we see that here a bottom-up approach is followed. Lastly, we see that the calculator app has been developed using an event driven approach. It follows a GUI based implementation as forms are created. The functions are provided parameters which include the event that has been triggered. Inputs are converted from the text boxes that they are received from and once manipulated the are sent back to the forms to be shown on screen.
Carmen, T.H., Layperson, C.E., Rivest, R.L. and Stein, C., 2009. Introduction to algorithms. MIT press. Sedgewick, R. and Wayne, K., 2011. Algorithms. Addison-Wesley professional. Van Leeuwen, J. ed., 1991. Handbook of theoretical computer science (vol. A) algorithms and complexity. MIT Press. Munchausen, C.D., and Brown, J.L., 2008. Designing, visualizing, and discussing algorithms within a CS 1 studio experience: An empirical study. Computers & Education , 50 (1), pp.301-326.