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
package adt.bst; | |
import static org.junit.Assert.*; | |
import java.util.Arrays; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; |
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
package adt.bst; | |
import static org.junit.Assert.*; | |
import java.util.Arrays; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; |
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
lista2.insertFirst(4); | |
lista2.insertFirst(3); | |
lista2.insertFirst(2); | |
lista2.insertFirst(1); | |
lista2.insertFirst(0); | |
Assert.assertArrayEquals(new Integer[] { 0, 1, 2, 3, 4 }, lista2.toArray()); | |
lista2.remove(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
package adt.linkedList; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; | |
public class BritoTeste extends StudentLinkedListTest{ | |
private DoubleLinkedList<Integer> lista1; | |
private DoubleLinkedList<Integer> lista2; |
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
package adt.bst; | |
import static org.junit.Assert.*; | |
import java.util.Arrays; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; |
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
package adt.avltree; | |
import static org.junit.Assert.*; | |
import java.util.Arrays; | |
import org.junit.Before; | |
import org.junit.Test; | |
import adt.bst.BSTNode; |
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
@Override | |
public void insert(T element) { | |
if (element != null) { | |
BNode<T> node = search(element).node; | |
if (node != null) { | |
insert(node, element); | |
} | |
} | |
} |
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
adj = {} | |
w = {} | |
Q = set() | |
S = [] | |
def populate_w(v1, v2, f): | |
w[(v1, v2)] = f | |