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
package collections; | |
class DoublyLinkedList { | |
class Node { | |
int data; | |
Node next; | |
Node prev; | |
} |
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
package collections; | |
class Stack { | |
private int max = 10; | |
private int[] ar; | |
private int top = 0; // индекс вершины стека | |
// а заодно, и количество элементов в нём | |
public Stack() { |
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
package collections; | |
class MyArrayList { // этот класс необходимо полностью заменить на вашу реализацию эррейлиста!!! | |
private int size = 0; | |
private int[] data; | |
public MyArrayList() { | |
this(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
package collections; | |
class SinglyLinkedList { // реализованных в классе методов достаточно для работы стека! | |
class Node { | |
int data; | |
Node next; | |
} | |
private Node head; |
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
FileWorker.java: | |
package com.alex.stack.htmlparser; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.File; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.Vector; |
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
package collections; | |
import java.util.Random; | |
class Queue { | |
private int[] data; | |
private final int max; | |
private int count; |
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
package collections; | |
import java.util.Random; | |
class DoublyLinkedList { | |
class Node { | |
int data; | |
Node next; | |
Node prev; |
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
package collections; | |
import java.util.Random; | |
class PriorityQueue { | |
private int[] data; | |
private int[] priorities; | |
private int maxCount; | |
private int count = 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
package collections; | |
import java.io.IOException; | |
import java.util.Random; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.PriorityBlockingQueue; | |
class Program { | |
public static void main(String[] args) throws InterruptedException, IOException { |
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
package tree; // and change class name at line 237! | |
class Tree { | |
class Node { // inner class! | |
private int value; | |
private Node parent; | |
private Node right; | |
private Node left; |