Skip to content

Instantly share code, notes, and snippets.

View Deathnerd's full-sized avatar

Wes Gilleland Deathnerd

  • eLink Design
  • Lexington, KY
View GitHub Profile
void bubbleSort(){
bubbleSort(n-1, n-1);
}
void bubbleSort(int y, int x){
if(x==0 && y==0)
return;
for(int i=0; i <= n-1; i++){ //loop through the rows
for(int j=0; j<=n-1; j++){ //loop through the columns
public int maxSub(int m) {
int x = A[0][0];
int finalIndex=1;
int index = 0;
for (int i = 1; i <= m; i++) {
for (int j = 0; j < A.length; j++) {
index++;
int row = (index / size);
int column = (index % size)-1;
System.out.println("Row= ("+index+"/"+size+")="+row);
public int maxSub(int m) {
int x = A[0][0];
int index = 0;
for (int i = 1; i <= m; i++) {
if (A[i/A.length][i%A.length] > x) {
x = A[i/A.length][i%A.length];
index = i;
}
}
return index;
private void selectionSort(int len) {
if(len==1)
return;
int idx=maxSub(len-1);
int t = A[idx/A.length][idx%A.length];
A[idx/A.length][idx%A.length] = A[(len-1)/A.length][(len-1)%A.length];
A[(len-1)/A.length][(len-1)%A.length] = t;
selectionSort(len-1);
<?php
/**
* Created by PhpStorm.
* User: Deathnerd
* Date: 4/12/14
* Time: 5:58 PM
*/
if(empty($_GET)){
echo "Get not set";
<?php
/**
* Created by PhpStorm.
* User: Deathnerd
* Date: 4/12/14
* Time: 9:16 PM
*/
function get_key_values_from_database($key){
$db = mysqli_connect('localhost', 'root', 'root', 'db');
void traverse() {
Helper hlp = new Helper(null, head);
final Term curr = hlp.current;
while (curr != null) {
System.out.print(curr.getKey() + " ");
hlp.moveNext();
}
System.out.println();
}
package Homework10;
import java.util.Scanner;
/**
* Created by Deathnerd on 4/20/2014.
*/
class Checks {
public static boolean isNumber(char c) {
__author__ = 'deathnerd'
combinations = list()
for i in range(1, 7):
for j in range(1, 7):
for k in range(1, 7):
#this appends a list (a type of array) to the combinations list
combinations.append([k, j, i])
number_less_than_or_equal_to_sixty = 0.0
__author__ = 'deathnerd'
count = 0.0
for i in range(1, 7):
for j in range(1, 7):
for k in range(1, 7):
if (i+j+k)*10 <= 60:
count += 1