Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shaikrasheed99/data-structures-and-algorithms

Practice problems of DSA from LeetCode and GeeksForGeeks platforms.
https://github.com/shaikrasheed99/data-structures-and-algorithms

arrays bit-manipulation dsa dsa-algorithm dsa-learning-series dsa-practice geeksforgeeks java leetcode leetcode-java leetcode-practice leetcode-questions leetcode-solutions math number-theory patterns strings trees

Last synced: 8 days ago
JSON representation

Practice problems of DSA from LeetCode and GeeksForGeeks platforms.

Awesome Lists containing this project

README

        

# DSA Problems in Java

## Arrays:
* Easy:
* [1](https://leetcode.com/problems/two-sum/). Two Sum - [code](src/arrays/easy/TwoSum.java)
* [1672](https://leetcode.com/problems/richest-customer-wealth/). Richest Customer Wealth - [code](src/arrays/easy/MatrixTraversal.java)
* [1337](https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/). The K Weakest Rows in a Matrix - [code](src/arrays/easy/KWeakestRows.java)
* [496](https://leetcode.com/problems/next-greater-element-i/). Next Greater Element I - [code](src/arrays/easy/NextGreaterElementOne.java)
* [1475](https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop/). Final Prices With a Special Discount in a Shop - [code](src/arrays/easy/NextSmallerElement.java)
* [1979](https://leetcode.com/problems/find-greatest-common-divisor-of-array/). Find Greatest Common Divisor of Array - [code](src/arrays/easy/GCDInArray.java)
* [485](https://leetcode.com/problems/max-consecutive-ones/). Max Consecutive Ones - [code](src/arrays/easy/MaxConsecutiveOnes.java)
* [905](https://leetcode.com/problems/sort-array-by-parity/). Sort Array By Parity - [code](src/arrays/easy/SortArrayByParity.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/segregate-0s-and-1s5106/1). Segregate 0s and 1s - [code](src/arrays/easy/Segregate0sAnd1s.java)
* Medium:
* [54](https://leetcode.com/problems/spiral-matrix/). Spiral Matrix I - [code](src/arrays/medium/SpiralMatrixOne.java)
* [59](https://leetcode.com/problems/spiral-matrix-ii/). Spiral Matrix II - [code](src/arrays/medium/SpiralMatrixTwo.java)
* [2326](https://leetcode.com/problems/spiral-matrix-iv/). Spiral Matrix IV - [code](src/arrays/medium/SpiralMatrixFour.java)
* [1996](https://leetcode.com/problems/the-number-of-weak-characters-in-the-game/). The Number of Weak Characters in Game - [code](src/arrays/medium/NumberOfWeakCharacters.java)
* [503](https://leetcode.com/problems/next-greater-element-ii/). Next Greater Element II - [code](src/arrays/medium/NextGreaterElementCircular.java)
* [75](https://leetcode.com/problems/sort-colors/). Sort Colors - [code](src/arrays/medium/Sort0s1s2s.java)
* Hard:
* [41](https://leetcode.com/problems/first-missing-positive/). First Missing Positive - [code](src/arrays/hard/FirstMissingPositive.java)

## Math:
* Easy:
* [412](https://leetcode.com/problems/fizz-buzz/). Fizz Buzz - [code](src/math/easy/FizzBuzz.java)
* [9](https://leetcode.com/problems/palindrome-number/). Palindrome Number - [code](src/math/easy/PalindromeCheck.java)
* [1281](https://leetcode.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer/). Subtract the Product and Sum of Digits of an Integer - [code](src/math/easy/SubtractProductAndSum.java)
* [1290](https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer/). Convert Binary Number in a Linked List to Integer - [code](src/math/easy/BinaryLinkedListToDecimal.java)
* [231](https://leetcode.com/problems/power-of-two/). Power of Two - [code](src/math/easy/PowerOfTwo.java)
* [1175](https://leetcode.com/problems/prime-arrangements/). Prime Arrangements - [code](src/math/easy/PrimeArrangements.java)
* [258](https://leetcode.com/problems/add-digits/). Add Digits - [code](src/math/easy/AddDigits.java)
* [202](https://leetcode.com/problems/happy-number/). Happy Number - [code](src/math/easy/HappyNumber.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/lcm-and-gcd4516/1). LCM and GCD - [code](src/math/easy/GCDAndLCM.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/armstrong-numbers2727/1). Armstrong Number - [code](src/math/easy/ArmstrongNumberCheck.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/count-digits5716/1). Count digits - [code](src/math/easy/CountDigitsGFG.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/decimal-to-binary-1587115620/1). Decimal to Binary - [code](src/math/easy/DecimalToBinary.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/binary-number-to-decimal-number3525/1). Binary to Decimal - [code](src/math/easy/BinaryToDecimal.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/sum-of-all-divisors-from-1-to-n4738/1). Sum of all divisors from 1 to n - [code](src/math/easy/SumOfAllDivisors.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/sieve-of-eratosthenes5242/1). Sieve of Eratosthenes - [code](src/math/easy/SieveOfEratosthenes.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/prime-factors5052/1). Prime Factors - [code](src/math/easy/PrimeFactors.java)
* Medium:
* [7](https://leetcode.com/problems/reverse-integer/). Reverse Integer - [code](src/math/medium/ReverseInteger.java)
* [1390](https://leetcode.com/problems/four-divisors/). Four Divisors - [code](src/math/medium/FourDivisors.java)
* [204](https://leetcode.com/problems/count-primes/). Count Primes - [code](src/math/medium/CountPrimes.java)

## Bit Manipulation:
* Easy:
* [191](https://leetcode.com/problems/number-of-1-bits/). Number of 1 Bits - [code](src/bit_manipulation/easy/NumberOfOnes.java)
* [476](https://leetcode.com/problems/number-complement/). Number Complement - [code](src/bit_manipulation/easy/NumberCompliment.java)
* [190](https://leetcode.com/problems/reverse-bits/). Reverse Bits - [code](src/bit_manipulation/easy/ReverseBits.java)
* [136](https://leetcode.com/problems/single-number/). Single Number I - [code](src/bit_manipulation/easy/SingleNumber.java)
* [2220](https://leetcode.com/problems/minimum-bit-flips-to-convert-number/). Minimum Bit Flips to Convert Number - [code](src/bit_manipulation/easy/MinimumBitFlipsToConvertNumber.java)
* [338](https://leetcode.com/problems/counting-bits/). Counting Bits - [code](src/bit_manipulation/easy/CountingBits.java)
* [137](https://leetcode.com/problems/single-number-ii/). Single Number II - [code](src/bit_manipulation/easy/OneSingleNumberInGroupOfThreeNumbers.java)
* [260](https://leetcode.com/problems/single-number-iii/). Single Number III - [code](src/bit_manipulation/easy/TwoSingleNumbers.java)
* [405](https://leetcode.com/problems/convert-a-number-to-hexadecimal/). Convert a Number to Hexadecimal - [code](src/bit_manipulation/easy/ConvertANumberToHexadecimal.java)
* [268](https://leetcode.com/problems/missing-number/). Missing Number - [code](src/bit_manipulation/easy/MissingNumber.java)
* [67](https://leetcode.com/problems/add-binary/). Add Binary - [code](src/bit_manipulation/easy/AddBinary.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/check-whether-k-th-bit-is-set-or-not-1587115620/1). Check whether K-th bit is set or not - [code](src/bit_manipulation/easy/CheckKthBitIsSet.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/odd-or-even3618/1). Odd or Even - [code](src/bit_manipulation/easy/OddOrEven.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/set-kth-bit3724/1). Set kth bit - [code](src/bit_manipulation/easy/SetKthBit.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/set-the-rightmost-unset-bit4436/1). Set the rightmost unset bit - [code](src/bit_manipulation/easy/SetRightMostUnsetBit.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/find-position-of-set-bit3706/1). Find position of set bit - [code](src/bit_manipulation/easy/PositionOfSetBit.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/copy-set-bits-in-range0623/1). Copy Set Bits in Range - [code](src/bit_manipulation/easy/CopySetBitsInRange.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/find-xor-of-numbers-from-l-to-r/1). Find XOR of numbers from L to R - [code](src/bit_manipulation/easy/FindXORInRange.java)
* Medium:
* [371](https://leetcode.com/problems/sum-of-two-integers/). Sum of Two Integers - [code](src/bit_manipulation/medium/SumOfTwoIntegers.java)
* [201](https://leetcode.com/problems/bitwise-and-of-numbers-range/). Bitwise AND of Numbers Range - [code](src/bit_manipulation/medium/BitwiseAndOfNumbersRange.java)
* [1680](https://leetcode.com/problems/concatenation-of-consecutive-binary-numbers/). Concatenation of Consecutive Binary Numbers - [code](src/bit_manipulation/medium/ConcatenationOfConsecutiveBinaryNumbers.java)
* [78](https://leetcode.com/problems/subsets/). Subsets - [code](src/bit_manipulation/medium/Subsets.java)
* [50](https://leetcode.com/problems/powx-n/). Pow(x, n) - [code](src/bit_manipulation/medium/PowerOfXAndN.java)
* [29](https://leetcode.com/problems/divide-two-integers/). Divide Two Integers - [code](src/bit_manipulation/medium/DivideTwoIntegers.java)
* [Gfg](https://practice.geeksforgeeks.org/problems/count-total-set-bits-1587115620/1). Count total set bits - [code](src/bit_manipulation/medium/CountTotalSetBits.java)

## Strings:
* Easy:
* [557](https://leetcode.com/problems/reverse-words-in-a-string-iii/). Reverse Words in a String III - [code](src/strings/easy/ReverseWordsInString.java)

## Trees:
* Easy:
* [94](https://leetcode.com/problems/binary-tree-inorder-traversal/). Binary Tree Inorder Traversal - [code](src/trees/easy/InorderTraversal.java)
* [144](https://leetcode.com/problems/binary-tree-preorder-traversal/). Binary Tree Preorder Traversal - [code](src/trees/easy/PreorderTraversal.java)

## Pattens:
* [codes](src/patterns)