Young Hwan Namit Chase Michael Dustin Daohui Sai Nariman Ben Mary Chun 
Jiongran Sunghyun Grant Emma Yuying Zack PeterW StephenK JeVante Murun
Qi Adrian 

I have an array list of Candidates and they are not Comparable and I'd 
like to sort without running Collections.sort(...) or using Comparators
and also without running any kind of sort procedure. 

public class Example {
  public static void main(String[] args) {
    for (String n : args) {
      System.out.println( n );  
    }
  }
}

--

public class Example {
  public static void main(String[] args) {
    for (String n : args) {
      System.out.println( n );  
    }
    Node a = new Node(3, null, null); 
    System.out.println( a ); 
  }
}

public class Node {
  int number;
  Node left, right; 
  public Node(int number, Node left, Node right) {
    this.number = number; 
    this.left = left;
    this.right = right; 
  }
  public String toString() {
    return this.left + " " + this.number + " " + this.right;  
  }
}

--

public class Example {
  public static void main(String[] args) {
    for (String n : args) {
      System.out.println( n );  
    }
    Node a = new Node(3, null, null); 
    System.out.println( a ); 
    a.right = new Node(5, null, null); 
    System.out.println( a ); 
    a.right.left = new Node(4, null, null); 
    System.out.println( a ); 
    a.right.right = new Node(6, null, null); 
    System.out.println( a ); 
  }
}

--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run Example
null 3 null
null 3 null 5 null
null 3 null 4 null 5 null
null 3 null 4 null 5 null 6 null


--

Can we build a binary search tree for Candidates? 

How about one for Strings? 

Can we use the code from above (with numbers) or do we have to write new code every time? 

public class Example {
  public static void main(String[] args) {
    for (String n : args) {
      System.out.println( n );  
    }
    Node a = new Node(3, null, null); 
    System.out.println( "a: " + a ); 
    a.insert(5); 
    System.out.println( "a: " + a ); 
    a.insert(4); 
    System.out.println( "a: " + a ); 
    a.insert(6); 
    System.out.println( "a: " + a ); 
    Node b = new Node(6, null, null); 
    b.insert(4); 
    b.insert(5); 
    b.insert(3); 
    System.out.println( "b: " + b ); 
                             // how does b look on paper? 
    
    // a: (3 - (5 (4 - -) (6 - -)))
    // b: (6 (4 (3 - -) (5 - -)) -)
    
    // 3 --+-- 
    //     |
    //     +-- 5 --+-- 4 --+-- 
    //             |       | 
    //             |       +--
    //             |
    //             +-- 6 --+-- 
    //                     | 
    //                     +--

    // so how do we print this? 
    
    
                             // what gets printed? 
    // print: 3 4 5 6 
  }  
}

public class Node {
  int number;
  Node left, right; 
  public Node(int number, Node left, Node right) {
    this.number = number; 
    this.left = left;
    this.right = right; 
  }
  public String toString() {
    return this.left + " " + this.number + " " + this.right;  
  }
  public void insert(int value) {
    if (value == this.number) return; 
    else if (value < this.number) {
      if (this.left == null) {
        this.left = new Node(value, null, null); 
      } else {
        this.left.insert(value);  
      }
    } else {
      if (this.right == null) {
        this.right = new Node(value, null, null); 
      } else {
        this.right.insert(value);  
      }
    }
      
  }
}