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.BufferedReader; | |
import java.io.FileReader; | |
import java.util.StringTokenizer; | |
class Plagiarism { | |
String filename1; | |
String filename2; | |
String content1; | |
String content2; | |
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.Scanner; | |
class DynamicArray<T> implements MyArrayList<T> { | |
int end; | |
T[] array; | |
DynamicArray() { | |
end = -1; | |
array = (T[])new Object[10]; | |
} | |
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
class Node<T> { | |
T element; | |
Node<T> nextElement; | |
Node<T> previousElement; | |
public void setElement(T element) { | |
this.element = element; | |
} | |
public T getElement() { |
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
class LinkedListStack<T> { | |
Node<T> bottom; | |
Node<T> top; | |
MyStack() { | |
bottom = new Node<T>(); | |
top = new Node<T>(); | |
} | |
public void push(T element) { | |
Node<T> newNode = new Node<T>(); |
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.ArrayList; | |
@SuppressWarnings("unchecked") | |
class BinaryHeap<T extends Comparable<T>> implements BinaryHeapADT<T> { | |
int size; | |
T[] heapArray; | |
int heapSize; | |
BinaryHeap (int size) { | |
this.size = size; | |
heapArray = (T[]) new Comparable[size]; |
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.ArrayList; | |
@SuppressWarnings("unchecked") | |
class BinaryTree<T extends Comparable<T>> { | |
Node<T> rootNode; | |
int index = 0; | |
int level = 0; | |
int nodePointer = 0; | |
Node<T> childNode; |
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.ArrayList; | |
import java.util.Scanner; | |
import java.util.StringTokenizer; | |
import java.util.Queue; | |
import java.util.LinkedList; | |
class BinaryTrees<T extends Comparable<T>> { | |
Node<T> rootNode; | |
int index = 0; | |
int level = 0; |
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.ArrayList; | |
import java.util.Scanner; | |
import java.util.StringTokenizer; | |
class BinaryTreeHeight<T extends Comparable<T>> { | |
Node<T> rootNode; | |
int index = 0; | |
int level = 0; | |
int nodePointer = 0; | |
Node<T> childNode; | |
Node<T> traverseNode; |
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.Scanner; | |
import java.util.StringTokenizer; | |
import java.util.ArrayList; | |
@SuppressWarnings("unchecked") | |
class BinarySearchTree<T extends Comparable<T>> { | |
Node<T> rootNode; | |
int index = 0; | |
int level = 0; |
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.Scanner; | |
import java.util.StringTokenizer; | |
class FindingEdgesInGraph { | |
int[][] array; | |
int size; | |
int edgesCount; | |
FindingEdgesInGraph (int size) { | |
this.size = size; | |
array = new int[size][size]; |