This repository contains the solutions to typical tasks in OOP with topic "Collections". The project involves solving various problems using stacks, queues, and maps, applying OOP principles.
- Java Development Kit (JDK)
- Git
The project is divided into multiple questions, each addressing a specific problem using appropriate data structures.
-
Car Parking (Stack)
- Simulate a driveway using a stack where cars can be added or removed based on LIFO principle.
-
Flood Fill (Stack)
- Implement a flood-fill algorithm on a 10x10 grid using a stack.
-
Java Identifier Count (Map)
- Read a Java source file and produce an index of all identifiers with their occurrences.
-
Nested HTML Tags (Stack)
- Check if a sequence of HTML tags is properly nested using a stack.
-
Airport Flights (Queue)
- Simulate an airport runway system using two queues for takeoff and landing.
-
Stock Shares Tax Calculation (Queue)
- Calculate the profit from buying and selling stock shares using the FIFO rule.
-
Multi-Company Stock Shares Tax Calculation (Queue)
- Extend the previous problem to handle multiple companies using a map of queues.
-
Arithmetic Expression Calculator (Stack)
- Evaluate arithmetic expressions with operators and parentheses using a stack.
-
Backtracking through a Maze (Stack)
- Find a path through a maze from start to exit using a backtracking algorithm and a stack.
-
Shortest Distance to City (Map, TreeSet, PriorityQueue)
- Find the least expensive routes to all cities in a network from a given starting point using Dijkstra's algorithm.
-
Clone the repository:
git clone https://github.com/Roman-Manzhelii/Typical-Java-tasks-collections.git cd Typical-Java-tasks-collections -
Compile the project: Use your preferred IDE to open and compile the project.
Each question is implemented as a separate class with its own main method. To run a specific solution, execute the main method of the corresponding class.
For more information or questions, please contact: romamanzheliy1@gmail.com