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 <cmath> | |
using namespace std; | |
int jumpSearch(int L[], int length, int key){ | |
int left = 0; | |
int right = sqrt(length); | |
while(right < length && L[right] <= key){ |
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
''' | |
Function Name: positiveBinaryConversion | |
Number of Parameters: 1 | |
Type of Parameters: list | |
Return Value: list | |
Function Description: Increments a binary number by 1 | |
''' | |
def incrementBinaryByOne(num): | |
num.reverse() | |
if num[0] == '0': |
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.Scanner; | |
public class DecimalToBinary { | |
static Scanner scan; | |
static int decValue; | |
static Stack stack; | |
public static void main(String[] args){ | |
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
public class MergeSortTest { | |
public static final int max = 10; | |
public static void main(String[] args){ | |
int[] toSortArray = new int[max]; | |
//Required variables: | |
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
public class Main { | |
static final int MAX = 6; | |
static String words[]; | |
public static void main(String[] args) { | |
float[] probabilityHit = new float[MAX]; | |
float[] probabilityFailure = new float[MAX]; | |
Node root = null; | |
words = new String[MAX]; |
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 random | |
def main(): | |
toSortArray = list() | |
counterArray = list() | |
sortedArray = list() | |
lengthOfArray = 10 | |
for x in range(0, lengthOfArray): | |
toSortArray.append(random.randint(0,lengthOfArray-1)) | |
counterArray.append(0) |
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> | |
using namespace std; | |
void shell_sort(int L[], int length){ | |
int gap = length / 2; | |
while(gap > 0){ | |
int j = 0; |
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 random | |
class Node: | |
def __init__(self, key): | |
self.key = key | |
self.vertical = None | |
def insertItemBetween(first, current, last): | |
first.vertical = current | |
current.vertical = last |
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.Scanner; | |
public class kruskal{ | |
public static void main(String[] args){ | |
Scanner scan = new Scanner(System.in); | |
int[][] matrix = new int[5][5]; | |
int[] parent = new int[5]; | |
int min; |
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 <cstring> | |
using namespace std; | |
char* getSubstring(char c[], int starting, int ending){ | |
int length = ending - starting + 1; | |
int temp = length; | |
if(ending < starting){ |