#include<stdio.h> #include<conio.h> #include<math.h> #include<graphics.h> void draw_line(float,float,float,float); main() { int driver,mode; float x1,y1,x2,y2; clrscr(); printf("Enter the two endpoints of the line:"); printf("\nx1 ="); scanf("%f",&x1); printf("y1 ="); scanf("%f",&y1); printf("x2 ="); scanf("%f",&x2); printf("y2 ="); scanf("%f",&y2); clrscr(); driver = DETECT; initgraph(&driver,&mode,"\\tc\\bgi"); \\path of bgi can be different in your case draw_line(x1,y1,x2,y2); getch(); closegraph(); } void draw_line(float x1,float y1,float x2,float y2) { float dy,dx; float x,y; float p,p0,dp1,dp2; dy = y2-y1; dx = x2-x1; p0 = 2 * (dy - dx); dp1 = 2 * dy; dp2 = 2 * (dy - dx); putpixel(x1,y1,EGA_WHITE); p = p0; for(x=x1+1,y=y1;x<x2;x++) { if(p < 0) { p = p+dp1; putpixel(x,y,EGA_WHITE); } else { p = p+dp2; y++; putpixel(x,y,EGA_WHITE); } }
dda algorithm,
bresenham's algorithm,
midpoint algorithm..
These are the few that are useful in my opinion.
automobile programming language implementation by algorithm
Yes. It is possible to provide a solution to the diamond-square algorithm using Java and recursion.
Compare two numbers, a and b. If a is greater than b then return a, otherwise return b. In C, we can implement this algorithm using the ternary operator (?:), as follows: return a>b?a:b;
An algorithm is a instruction for solving a problem. It is typically illustrated using prose, pseudo code or flowcharts, but other methods exist. The algorithm is the "here's how it's going to work" part of the solution. An implementation (of an algorithm) is a specific expression of this algorithm, using a specific programming language or any other suitable means. The implementation is the "here's how I've done it" part of the solution.
Perform encryption on the following PT using RSA and find the CT p = 3; q = 11; M = 5
Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.
Yes. It is possible to provide a solution to the diamond-square algorithm using Java and recursion.
You can compute sin(x) manually/numerically using Taylor's Series.
if u having this project means mail to aravindramesh11@gmail.com
Compare two numbers, a and b. If a is greater than b then return a, otherwise return b. In C, we can implement this algorithm using the ternary operator (?:), as follows: return a>b?a:b;
An algorithm is a description of a method for accomplishing some task. For example, an algorithm for driving to a friend's house could be:1. Find your keys2. Get into the car3. Start the engine4. Put transmission into gearetc...Psuedocode is an implementation of an algorithm in a code-like format. For example, the above algorithm in psuedocode could look something like:while(keys.location != "in your hand"){search_for_keys();}walk_to_car();if(car.door == locked)car.door.unlock();engine.start();...An algorithm describes the steps required to solve a problem. Algorithms are written using natural language (e.g., English).Pseudocode is a human-readable version of an algorithm written using an informal language that is very similar to a programming language but which can be more easily translated into any specific programming language.
pro c language to implement linear search using pointers
An algorithm is a instruction for solving a problem. It is typically illustrated using prose, pseudo code or flowcharts, but other methods exist. The algorithm is the "here's how it's going to work" part of the solution. An implementation (of an algorithm) is a specific expression of this algorithm, using a specific programming language or any other suitable means. The implementation is the "here's how I've done it" part of the solution.
A kernel is used to implement the SVM algorithm in practise. An input data space is transformed into the appropriate form using a kernel. The kernel trick is a technique used by SVM. The kernel transforms a low-dimensional input space into a higher-dimensional space in this case. To learn more about data science please visit- Learnbay.co
Perform encryption on the following PT using RSA and find the CT p = 3; q = 11; M = 5
Advantages of an Algorithm: Effective Communication: Since the algorithm is written in English like language, it is simple to understand the step-by-step solutions of the problems. Easy Debugging: Well-designed algorithm makes debugging easy so that we can identify a logical error in the program. Easy and Efficient Coding: An algorithm acts as a blueprint of a program and helps during program development. Independent of Programming Language: An algorithm is independent of programming languages and can be easily coded using any high-level language. Disadvantages of an Algorithm: Developing algorithms for complex problems would be time-consuming and difficult to understand. Understanding complex logic through algorithms can be very difficult.
GCF(437,1247) using Euclidean algorithm
Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.