This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdlib.h> | |
#include<stdio.h> | |
#include<math.h> | |
#include<GL/glut.h> | |
int xstart, ystart, xend, yend; | |
void init() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bresenham's Line Drawing Algorithm implemented in C and ncurses. | |
* Based on https://rosettacode.org/wiki/Bitmap/Bresenham%27s_line_algorithm#C - there are probably better ways than doing this. | |
**/ | |
#include <stdlib.h> | |
#include <ncurses.h> | |
/** Implement Bresenham's Line Drawing Algorithm. **/ | |
void drawBresenhamLine(int startXLocation, int startYLocation, int endXLocation, int endYLocation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MaxSumSubarray: | |
""" | |
Approaches to solving the Maximum Subarray problem. | |
""" | |
def __init__(self, arr): | |
self.arr = arr | |
def brute_force(self): | |
""" | |
Uses brute force approach to find maximum sum of subarray for inputted array. |