This file contains hidden or 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
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 |
This file contains hidden or 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
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); |
This file contains hidden or 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
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; |
This file contains hidden or 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
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); |
This file contains hidden or 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
<?php | |
/** | |
* Created by PhpStorm. | |
* User: Deathnerd | |
* Date: 4/12/14 | |
* Time: 5:58 PM | |
*/ | |
if(empty($_GET)){ | |
echo "Get not set"; |
This file contains hidden or 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
<?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'); |
This file contains hidden or 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
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(); | |
} |
This file contains hidden or 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
package Homework10; | |
import java.util.Scanner; | |
/** | |
* Created by Deathnerd on 4/20/2014. | |
*/ | |
class Checks { | |
public static boolean isNumber(char c) { |
This file contains hidden or 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
__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 |
This file contains hidden or 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
__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 |
OlderNewer