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
tinyurl.com/tpwbooks |
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
import java.util.*; | |
public class MergeSort | |
{ | |
public int[] a; | |
public MergeSort() | |
{ | |
a = new int[] { 0, 6, 41, 54, 57, 874, 243, 324, 1, 23, 4, 69, 7, 104 }; | |
} |
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
import java.util.Arrays; | |
public class QuickSort | |
{ | |
public int[] a; | |
public QuickSort() | |
{ | |
a = new int[] { 0, 6, 41, 54, 57, 874, 243, 324, 1, 23, 4, 69, 7, 104 }; | |
} |
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
import java.io.*; | |
public class BinarySearch | |
{ | |
public int[] a; | |
public BinarySearch() | |
{ | |
a = new int[] { 0, 1, 2, 3, 4, 8, 10, 14 }; |
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
import java.io.*; | |
public class Trie | |
{ | |
private TrieNode root; | |
public Trie() | |
{ | |
root = new TrieNode( ' ' ); | |
} |
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 class BinaryTree | |
{ | |
public void insert( TreeNode node, int value ) | |
{ | |
if( value < node.value ) { | |
if( node.left != null ) { | |
insert( node.left, value ); | |
} else { | |
System.out.println( " Inserted " + value + " to left of node " + node.value ); | |
node.left = new TreeNode(value); |
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
// Created by: Thomas Hewton-Waters | |
// Date: February 18, 2012 | |
/* The program will generate all permutations of the input string. */ | |
#include <stdio.h> | |
#include <string.h> | |
void merge( char end, char str[], char perms[][100] ); | |
void permutate( char str[], int index, int *num_perms ); |
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
/* To use Scanner class */ | |
import java.util.Scanner; | |
/* To write to file */ | |
import java.io.*; | |
public class EasyChallengeOne | |
{ | |
private String name; | |
private String age; |