The repo consists of solutions to numerous problems using different data structures and algorithms, all coded in Java. It also contains solutions to HackerRank problems which I have solved so far and questions from Cracking the Coding Interview Book (6th Edition).
You can also refer to my Java Notes for a quick refresh on the Java concepts. Lastly, feel free to connect with me on Twitter for any queries or concerns. All the best!
- Basic Practice:
- Arrays
- ArrangeNosToFormBiggestNo
- BooleanMatrix
- CelebrityProblem
- ConsecutiveElements
- CountDivisors
- CountSmallerElementsOnRHS
- DistinctPairs
- DuplicatesInArray
- DuplicatesInArrayWithinKDistance
- EqualProbabilityRandomNoGenerator
- EquilibriumIndex
- FixedPoint
- FlattenArray
- IntersectionAndUnionOf2SortedArrays
- InversionsInArray
- KLargestElements
- KthLargestElement
- LargestProductContiguousSubArray
- LargestSumContiguousSubArray
- LeadersInArray
- LongestBitonicSubArray
- LongestConsecutiveSubsequence
- MajorityElement
- MajorityElementInSortedArray
- MatrixInSpiral
- MaxDiffWithLargerElementAfterSmallerElement
- MaxInAllSubArrays
- MaxIndexDiff
- MaxMinWithMinComparisons
- MaxSpan
- MaximumSizeSquareSubMatrix
- MaximumSumNonAdjacentSubSequence
- MedianOfStream
- MedianOfTwoSortedArrays
- MergeArrayOfNIntoArrayOfMPlusN
- MinimumDistanceBetweenTwoNos
- MissingAndRepeatingElements
- MissingNumber
- NextGreaterElement
- NextLargerNumber
- NthSmallestNumber
- NumberOccurringOddTimes
- OccurrencesInSortedArray
- PairDiff
- PairSum
- PivotedBinarySearch
- ProductArrayPuzzle
- ReservoirSampling
- ReverseArray
- RotateArray
- RotateMatrixBy90Degrees
- RotatedIndex
- SearchInSorted2DArray
- Segregate0s1sAnd2s
- Segregate0sAnd1s
- SegregateEvenAndOddNos
- SmallestAndSecondSmallest
- SmallestMissingNumber
- SortedSubSequence
- SubArrayOfSum
- SubsetOfArray
- SymmetricDifference
- TripletOfSum
- TwoElementsSumClosestToZero
- TwoRepeatingElements
- TwoStacksInOneArray
- UnsortedSubArray
- Backtracking
- Bits
- AbsWithoutBranching
- Addition
- BinaryGap
- BinaryString
- BooleanArrayPuzzle
- ConvertAToB
- CountSetBits
- CountSetBitsFromMinusNtoN
- ElementOccurringOnce
- FlippingBits
- IntegerOverflow
- LittleAndBigEndian
- MaxWithoutBranching
- Modulo
- MultipleOf3
- Multiply
- NextHigherNumber
- NextPowerOf2
- OppositeSign
- Parity
- PowerOf2
- PowerOf4
- README.md
- ReverseBits
- RightShiftOperator
- RightmostSetBit
- RotateBits
- ShiftByNegativeNumber
- SmallestOf3Integers
- StrCmp
- SubBit
- SwapBits
- TwoNonRepeatingElements
- Blockchain Demo
- Dynamic Programming
- Graphs
- Java 8
- Linked Lists
- AddNumbersInTwoLists
- CloneWithRandPointers
- DeleteAlternateNodes
- DeleteLesserNodes
- DeleteMnodesAfterNnodes
- DeleteNode
- DetectAndRemoveLoop
- DetectLoop
- DivideCircularListIntoTwo
- FlattenMultiLevelLinkedList
- Identical
- InsertInSortedCircularLinkedList
- InsertInSortedList
- IntersectionAndUnionOf2Lists
- IntersectionOf2SortedLists
- IntersectionPointOfTwoLists
- LRUCache
- MaximumSumLinkedList
- MergeSort
- MergeSortDoubleLinkedList
- MergeTwoLinkedListAlternatively
- MergeTwoSortedLists
- MiddleNode
- MoveLastNodeToFirst
- NthNodeFromLast
- PairWiseSwap
- Palindrome
- QuickSort
- RandomNode
- RemoveDuplicates
- RemoveMiddlePointsFromLineSegments
- ReverseAlternateNodesAndAppendAtEnd
- ReverseDoubleLinkedList
- ReverseLinkedListInAlternateGroups
- ReverseLinkedListInGroups
- ReverseSingleLinkedList
- RotateLinkedList
- SegregateEvenOddNumbers
- SortAlternativelySortedLinkedList
- SortLinkedListOf0s1s2s
- SortedDLLToBBST
- StackWithOperationOnMiddleElement
- SwapKthNode
- SwapNodes
- TripletFromThreeLinkedLists
- Miscellaneous
- BotTesting
- BreakParagraph
- CollectionIteration
- DivideByZero
- Equals
- GarbageCollection
- GenericNonGenericMix
- HitCount
- MapReduce
- MapWithTimestamp
- MethodLocalVSInner
- MethodOverloading
- Outer
- OuterClassAccess
- RandomTest
- ReadFile
- RecursiveWarmup
- RegexReplaceAllSpaces
- RegexValidateLatLong
- ReverseAndAdd
- TreeList
- parenthesis
- reverseandadd
- Permutations
- Searching
- Sorting
- Stacks
- Strings
- Threads
- Trees
- BFSUsingQueue
- CheckForBST
- ChildrenSum
- ConnectNodesAtSameLevel
- ConstructTreeFromInOrderAndPreOrder
- DoubleTree
- HeightBalanced
- IdenticalTrees
- InOrderUsingStack
- InOrderWithoutStackAndRecursion
- LeafNodes
- LeastCommonAncestorInBST
- LeastCommonAncestorInBT
- MirrorTree
- RandomNodeInBT
- RootToLeafPaths
- SecondSmallestInBST
- SpiralTraversal
- TreeToList
- TwoSwappedNodesInBST
- Arrays
- Cracking the Coding Interview:
- LeetCode.
- HackerRank.
Java version 1.8.0_172
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
IntelliJ IDEA 2018.1.4 (Ultimate Edition)
MacBook Pro
2.5 GHz Intel Core i7
16 GB 1600 MHz DDR3