src/PokerHand.java
public void insertInOrder(Card card) {
		// Insert the first card
		if (head == null) {
			head = new LinkNode<Card>(card, null);
			return;
		}

		LinkNode<Card> ref = head;
		LinkNode<Card> temp;

		// Insert at the first position
		if (ref.getData().compareTo(card) > 0) {
			temp = new LinkNode<Card>(card, ref);
			head = temp;
			return;
		}

		// Inserting in regular case
		while (ref.getNext() != null) {
			if (ref.getNext().getData().compareTo(card) > 0) {
				temp = new LinkNode<Card>(card, ref.getNext());
				ref.setNext(temp);
				return;
			}
			ref = ref.getNext();
		}

		// Insert at the last position
		temp = new LinkNode<Card>(card, null);
		ref.setNext(temp);
	}
// Every card is originally inserted in a list starts with "head"
Every card is originally inserted in a list starts with "head"
Every card is originally inserted in a list starts with " head "
public void insertInOrder(Card card) {
		if (head == null) {
			head = new LinkNode<Card>(card, null);
			return;
		}
		LinkNode<Card> ref = head;
		LinkNode<Card> temp;
		if (ref.getData().compareTo(card) > 0) {
			temp = new LinkNode<Card>(card, ref);
			head = temp;
			return;
		}
		while (ref.getNext() != null) {
			if (ref.getNext().getData().compareTo(card) > 0) {
				temp = new LinkNode<Card>(card, ref.getNext());
				ref.setNext(temp);
				return;
			}
			ref = ref.getNext();
		}
		temp = new LinkNode<Card>(card, null);
		ref.setNext(temp);
	}
public void insertInOrder ( Card card ) { if ( head == null ) { head = new LinkNode < Card > ( card , null ) ; return ; } LinkNode < Card > ref = head ; LinkNode < Card > temp ; if ( ref . getData ( ) . compareTo ( card ) > 0 ) { temp = new LinkNode < Card > ( card , ref ) ; head = temp ; return ; } while ( ref . getNext ( ) != null ) { if ( ref . getNext ( ) . getData ( ) . compareTo ( card ) > 0 ) { temp = new LinkNode < Card > ( card , ref . getNext ( ) ) ; ref . setNext ( temp ) ; return ; } ref = ref . getNext ( ) ; } temp = new LinkNode < Card > ( card , null ) ; ref . setNext ( temp ) ; }
Every card is originally inserted in a list starts with "head"
Every card is originally inserted in a list starts with " head "
// Insert the first card // Insert at the first position // Inserting in regular case // Insert at the last position