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 <iostream> | |
#include <stack> | |
#include <string> | |
#include <queue> | |
#include <vector> | |
using namespace std; | |
bool is_valid_parens(const string &parens) { | |
stack<char> s; | |
for (size_t i = 0; i < parens.length(); ++i) { |
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
node *insert(node *root, int value) { | |
node *current = root; | |
node *prev; | |
if (root == NULL) { | |
root = (node *)malloc(sizeof(node)); | |
root->data = value; | |
root->left = NULL; | |
root->right = NULL; | |
return root; |
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 <iostream> | |
#include <vector> | |
int32_t make_change(const std::vector<int32_t> &denominations, | |
const int32_t &amount, | |
std::vector<int32_t> &coin_count, | |
std::vector<int32_t> &coins_used) { | |
for (int32_t i = 0; i < amount + 1; ++i) { | |
int32_t count = i; | |
int32_t new_coin = 1; |
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 <string.h> | |
int main(int argc, char* *argv) | |
{ | |
// FOR STREAM VIEWERS | |
// A buddy of mine into security/cryptography challenged me to this | |
// "very easy" problem. | |
// Now I'm making a friend of mine and YOU guys try and solve the same | |
// challenge |
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
/* Aaron Wilson | |
* Dr. Kalita | |
* CS 4720 - Design and Analys of Algorithms | |
* May 4, 2016 | |
* Email: awilson8@uccs.edu | |
* | |
* Assignment 4, Problem 2: Dijkstra's Algorithm | |
*/ | |
#include <iostream> |
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
Why coding streams/shows are interesting to me: in some livestreams, the experience is very similar to pair programming, | |
but those people are experts. In VODs, it's more about problem solving and learning skills and approaches. The devs are really good | |
at what they do and there is *always* a lot to learn. | |
In no particular order: | |
1) Handmade Hero | |
About the author: Casey Muratori. Worked at RAD. | |
Description and why I like it: It kinda started the whole thing for me. Casey is coding a complete game and engine on stream, | |
from scratch, one hour a day. He knows what he's doing on so many of the domains of game development and regular programing, |
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 <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <math.h> | |
double absd(double n) { | |
unsigned long *gg = (unsigned long int *)&n; | |
*(gg) &= 0x7FFFFFFFFFFFFFFFull; | |
return n; | |
} |
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
import java.util.*; | |
public class Solution { | |
public boolean repeatedSubstringPattern(String str) { | |
int length = str.length(); | |
if (length <= 1) return false; | |
List<Integer> factors = new ArrayList(); | |
// Factor | |
for (int i = 1; i * 2 <= length; ++i) { |
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
#!/bin/bash | |
# This script will print all java files found recursively from the current directory, and then print the ones that | |
# have not been involved in a git commit in some number of months | |
# | |
# Based on: | |
# https://hackerific.net/2016/04/30/git-file-age-a-script-to-show-when-files-were-last-modified-in-git/ | |
find . -name *.java | xargs -I § git log -1 --pretty="format:%ct %cr %h §;" § | tr ';' '\n' | sort | cut -f 2- | grep "month" |
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
import java.util.*; | |
public class Solution { | |
private int numberOfOneBits(int num) { | |
int count = 0; | |
while (num != 0) { | |
if ((num & 1) == 1) { | |
++count; | |
} | |
num >>= 1; | |
} |