/data-structures-and-algorithms

A compilation of DSA things i do and document to mark my progress and keep an archive to come back if i ever need to revise, and also for other people who might be interested in something similar.

Primary LanguageJava

Data Structures and Algorithms Repository

Welcome to my data structures and algorithms repository! This repository contains solutions to various problems on different platforms (e.g., LeetCode, HackerRank, etc.).

Folder Structure

The repository is organized as follows:

  • Basics: Contains folders for each programming language used in the problem solutions. For example: Java, Python, C++.
  • LeetCode: Holds individual problems on LeetCode platforms.

Note: Will add more problems from different Problems.

data-structures-and-algorithms/
Basics
|--- 1. Data Type & Operators
|---|--- Q1. Hello World
|---|---|--- Java
|---|---|---|--- Aashish.java
|---|---|---|--- Palak.java
|---|---|---|--- Vatsal.java
|---|---|--- readme.md
|---|--- Q2. Hello World -4
|---|---|--- Java
|---|---|---|--- Palak.java
|---|---|---|--- Vatsal.pr.3.Java
|---|---|--- readme.md
|--- 2. If Else...
LeetCode
|--- Q1342. Number of Steps to Reduce a Number to Zero
|---|--- Java
|---|---|--- aashish.java
|---|--- JavaScript
|---|---|--- aashish.js
|---|--- readme.md
|--- Q1480. Running Sum of 1d Array
|---|--- Java
|---|---|--- Java.java
|---|--- JavaScript
|---|---|--- JavaScript.js
|---|--- readme.md

Guidelines

Solving a Problem

  1. Choose a problem from the problems folder that you'd like to solve.
  2. Select a programming language from the languages folder and follow the guidelines for that language.
  3. Write your solution in the specified format (e.g., as described below).
  4. Save the file with your name as the filename, followed by the problem number. For example: aashish.java.

Storing the Solution

To store a solution:

  1. Create a new branch for the specific problem you're solving.
  2. Place your solution in the corresponding folder within languages (e.g., Java/aashish.java).
  3. Commit and push your changes to your GitHub repository.

Contributing

This repository is open to contributions! If you'd like to add a new problem or improve existing solutions, feel free to submit a pull request.

Problem Submission

To contribute a new problem:

  1. Create a new folder within the problems directory for the specific platform.
  2. Add the problem description and any relevant details (e.g., link to the original problem).
  3. Submit a pull request with your changes.

License

This repository is licensed under the MIT License.

Contact

If you have any questions or would like to collaborate, please don't hesitate to reach out!

To run or write the code, use the Scaler Topics online compilers:

Java Online Compiler.
JavaScript Online Compiler.
Python Online Compiler.
C Online Compiler.
C++ Online Compiler.

List of All Problems

ProblemSolved
Q1. Hello World
Q10. A Simple Calculator
Q11. Concatenate Two Numbers
Q12. Add 10
Q13. Print sentence
Q14. Hello Name
Q15. Number of bills
Q16. Total Bills Value
Q17. Remaining Bake Time
Q18. Preparation Time
Q19. Total Elapsed Cooking Time
Q2. Hello World -4
Q3. Getting Started - 1
Q4. Hello World ! - 2
Q5. Manual pattern printing - 1
Q6. Manual pattern printing - 2
Q7. Simple Maths
Q8. A says Hi to B
Q9. Print A B C D E
Q1. Categorise the number - Nested if-else
Q10. Fizz Buzz
Q11. Angles Of Valid Triangle
Q12. Profit Or Loss
Q13. Coding Rating
Q14. Days In Month
Q15. Min of three
Q16. Bank Account
Q17. Divisible by 2 numbers
Q18. Floor of A
Q2. Check even
Q3. Which Month
Q4. Max of three
Q5. Percentage and Grade
Q6. Which triangle
Q7. Min of two
Q8. Confusion In Electricity Bill
Q9. Print last digit
Q1. From top to down
Q10. Sum the digits
Q11. Sum of Odds - Easy
Q12. Sum of Evens - easy
Q13. Easy Power
Q14. Multiplication Table
Q15. Bank Account - 2
Q16. Palindromic Integer
Q2. From down to top
Q3. Odd Game
Q4. Even Game
Q5. Summation Game
Q6. Multiples of 4
Q7. Print perfect squares
Q8. First vs Last
Q9. Count the digits
Q1. Count factors
Q10. Print the Primes
Q11. Numeric Stair Pattern
Q12. Inverted Half Pyramid
Q13. Two Line Star Pattern
Q2. Is It Prime
Q3. Is It Perfect
Q4. Print N stars
Q5. Print a matrix of stars
Q6. Stair Pattern
Q7. LCM - Easy
Q8. HCF - Easy
Q9. Armstrong Numbers
Q1. Skip Even Numbers Half Pyramid
Q10. Half Diamond
Q11. Inverted Full Pyramid
Q12. Hollow Inverted Half Pyramid
Q2. Leading spaces pyramid
Q3. Inverted Numeric Pyramid
Q4. Hollow inverted pyramid pattern
Q5. Hollow pyramid pattern
Q6. Full pyramid
Q7. Leading spaces inverted pyramid
Q8. Photo Frame Pattern
Q9. Different Number Triangle
Q1. Area of Circle
Q2. Volume Of Sphere
Q3. Favourite Chocolate
Q4. Sum of evens!
Q5. Power function
Q6. Count of primes
Q7. HCF - Easy
Q8. LCM - Easy
Q9. Is Perfect Square ?
Q1. Print in Reverse
Q10. Negative Integers
Q11. Even Odd Elements
Q12. Separate Odd Even
Q13. Product of elements
Q14. Frequency count
Q15. Pair Count
Q16. Consecutive Duplicate
Q2. Insert that
Q3. Max and Min of an Array
Q4. Sum the Array
Q5. Copy the Array
Q6. Search Element
Q7. Frequency of X in Array
Q8. Check if Array is Sorted
Q9. Remove that
Q1342. Number of Steps to Reduce a Number to Zero
Q1480. Running Sum of 1d Array
Q1672. Richest Customer Wealth
Q412. Fizz Buzz