Skip to content

Instantly share code, notes, and snippets.

@rzel
rzel / BresenLine.c
Created December 16, 2023 05:50 — forked from souravrane/BresenLine.c
OpenGL - Bresenham's Line drawing algorithm
#include<stdlib.h>
#include<stdio.h>
#include<math.h>
#include<GL/glut.h>
int xstart, ystart, xend, yend;
void init()
{
@rzel
rzel / bresenham.c
Created December 16, 2023 05:49 — forked from JamesPhillipsUK/bresenham.c
Bresenham's Line Drawing Algorithm implemented in C and ncurses.
/**
* 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)
@rzel
rzel / kadane.py
Created October 31, 2023 16:56 — forked from samsonq/kadane.py
Kadane's Algorithm for Maximum Sum Subarray
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.