Java Programming Exercises
Java
During my fourth semester at Savonia University of Applied Sciences, I took a course on Data Structures and Algorithms. During this time, I learned Java programming and engaged in various class exercises, problem-solving tasks, and additional assignments. Here are the topics I covered:
The Following Topics Covered
-
Introduction Task (Basics)
-
Efficiency Analysis
-
Sorting
-
Lists
-
Hash Table
-
Binary Search Tree
-
Heap
-
Backtracking
Getting Started
To get started with this repository, follow the instructions below based on your operating system.
Prerequisites
-
Ensure you have Java Development Kit (JDK) installed. You can download it from Oracle’s official site.
-
Install IntelliJ IDEA, a popular Java IDE.
Cloning the Repository
First, clone the repository to your local machine:
<font color="#c0504d">git clone</font> https://github.com/SAJIB3489/problem_solving-Java.git
cd problem_solving-Java
Debugging with IntelliJ IDEA
Windows Users
- Open IntelliJ IDEA:
Launch IntelliJ IDEA from your Start Menu or Desktop shortcut.
- Import the Project:
Go to File → Open… and navigate to the directory where you cloned the repository.
Select the project folder and click OK.
- Configure JDK:
IntelliJ might prompt you to configure the JDK if it’s not already set. Point to the JDK installation path (e.g., C:\Program Files\Java\jdk-17
).
- Build the Project:
Go to Build → Build Project to compile the code.
- Run/Debug a Program:
Open the Java file you want to debug.
Set breakpoints by clicking on the left margin of the code editor.
Right-click inside the editor and select Debug
IntelliJ will start the debugger, and execution will pause at the breakpoints you set. You can then step through the code, inspect variables, and evaluate expressions.
Linux Users
- Open IntelliJ IDEA:
Launch IntelliJ IDEA from your Applications menu or via terminal by typing intellij-idea-ultimate (or intellij-idea-community if you have the community edition).
- Import the Project:
Go to File → Open… and navigate to the directory where you cloned the repository.
Select the project folder and click OK.
- Configure JDK:
IntelliJ might prompt you to configure the JDK if it’s not already set. Point to the JDK installation path (e.g., /usr/lib/jvm/java-17-openjdk
).
- Build the Project:
Go to Build → Build Project to compile the code.
- Run/Debug a Program:
Open the Java file you want to debug.
Set breakpoints by clicking on the left margin of the code editor.
Right-click inside the editor and select Debug
IntelliJ will start the debugger, and execution will pause at the breakpoints you set. You can then step through the code, inspect variables, and evaluate expressions.
Note
You can download the full repository from my Github. Thank you.