Skip to content

Roman-Manzhelii/Typical-Java-tasks-collections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typical Java tasks (collections)

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.

Requirements

  • Java Development Kit (JDK)
  • Git

Project Structure

The project is divided into multiple questions, each addressing a specific problem using appropriate data structures.

Questions and Solutions

  1. Car Parking (Stack)

    • Simulate a driveway using a stack where cars can be added or removed based on LIFO principle.
  2. Flood Fill (Stack)

    • Implement a flood-fill algorithm on a 10x10 grid using a stack.
  3. Java Identifier Count (Map)

    • Read a Java source file and produce an index of all identifiers with their occurrences.
  4. Nested HTML Tags (Stack)

    • Check if a sequence of HTML tags is properly nested using a stack.
  5. Airport Flights (Queue)

    • Simulate an airport runway system using two queues for takeoff and landing.
  6. Stock Shares Tax Calculation (Queue)

    • Calculate the profit from buying and selling stock shares using the FIFO rule.
  7. Multi-Company Stock Shares Tax Calculation (Queue)

    • Extend the previous problem to handle multiple companies using a map of queues.
  8. Arithmetic Expression Calculator (Stack)

    • Evaluate arithmetic expressions with operators and parentheses using a stack.
  9. Backtracking through a Maze (Stack)

    • Find a path through a maze from start to exit using a backtracking algorithm and a stack.
  10. 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.

Installation and Setup Instructions

  1. Clone the repository:

    git clone https://github.com/Roman-Manzhelii/Typical-Java-tasks-collections.git
    cd Typical-Java-tasks-collections
  2. Compile the project: Use your preferred IDE to open and compile the project.

Usage Instructions

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.

Author

Roman Manzhelii

Contact

For more information or questions, please contact: romamanzheliy1@gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages