Skip to content
a collection of common data structures and algorithmic puzzles
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Data Structure, Algorithms and Puzzles Build Status codecov

a collection of common algorithms, puzzles and problems related to data structures and solution optimization.

String (io.algonomics.ds.strings)

  1. ReverseString : Write a program to reverse a String.
  2. RemoveDuplicates : Write a program to remove duplicate characters from an input String.
  3. MostFrequentCharacter : Return maximum occurring character in an input String.
  4. RemoveCommonCharacters : Remove characters from the first string which are present in the second string
  5. CheckForAnagram : Write a program to check if two strings are anagrams of each other.
  6. CountCharactersByPosition : Count number of characters at same position in the given string as in english language

Array (io.algonomics.ds.arrays)

  1. RemoveDuplicates : Remove duplicate values from an integer array
  2. PairSum : Given an array A[] and a number x, check for pair in A[] with sum as x
  3. SearchSortedAndRotatedArray : Search an element 'e' in a sorted and rotated array of size n
  4. ArrayRotation : Write a program to rotate(arr[], d) that rotates arr[] of size n by d elements
  5. ReverseArray : Write a program to reverse an array using iterative and recursive approach
  6. SegregateElements : Segregate 0s on left side and 1s on right side of the array.
  7. ShuffleArray : Write a program to shuffle an Array
  8. SegregateEvenOdd : Write a program to segregate even and odd numbers in an array.
  9. FindMinimumElementInSortedRotatedArray : A sorted array is rotated at some unknown point, find the minimum element in it (assuming all the distinct elements in the array)
  10. MergeKSortedArrays : Given k sorted arrays of size n each, merge them and return the sorted output.
  11. WaveSorting : Sort an array in wave form

LinkedList (io.algonomics.ds.linkedlists)

  1. FindIntersectionPoint : Write a program to get the intersection point of two Linked Lists.
  2. MergeSortedLists : Write a program to merge two sorted linked lists
  3. PrintReversedLinkedList : Write a program to print a linked list in reversed order using recursion.
  4. RemoveDuplicatesFromSortedList : Write a program to remove dupliate entries from sorted linked List.
  5. AlternatingSplit : Write a program to split a linkedList in two lists each having alternate elements from the original list.
  6. IdenticalLists : Write a program to check the equality of two lists.

Stack (io.algonomics.ds.stacks)

  1. ReverseStack : Write a program to reverse a stack using just the supported operations using recursion.
  2. NextGreaterElement : Given an array, print the Next Greater Element (NGE) for every element.
  3. CelebrityProblem : In a party of N people, only one person is known to everyone. We can only ask questions like "Does A know B?". Find the stranger (celebrity) in minimum number of questions.
  4. OverlappingIntervals : Given a set of time intervals in any order, merge all overlapping intervals into one and output the result. This specific solution uses O(n) extra space.

Searching Algorithms (io.algonomics.algos.searching)

  1. LinearSearch : Implement the linear search algorithm
  2. BinarySearch : Implement the binary search algorithm
  3. JumpSearch : Implement the jump search algorithm
  4. InterpolationSearch : Implement the interpolation search algorithm

Sorting Algorithms (io.algonomics.algos.sorting)

  1. BubbleSort : BubbleSort or ComparisonSort sorting algorithm
  2. SelectionSort : SelectionSort sorting algorithm
  3. InsertionSort : InsertionSort sorting algorithm
  4. MergeSort : MergeSort sorting algorithm

Recursive Algorithms (io.algonomics.algos.recursion)

  1. PalindromeNumber : Given an integer, write a function that returns true if the given number is palindrome
  2. Factorial : Given a number, calculate its factorial using recursion
  3. FibonacciSeries : Given a number n, write a Fibonacci function to return the N'th term

Data Structure Implementations (io.algonomics.ds.impl)

LinkedList : A generic LinkedList dataStructure implementation holding elements in a 0 index based format. The list operations are not thread-safe and should be used accordingly. The following is the list of supported operations as of now :

- add(T value)
- add(T value, int index)
- get(int index)
- getSize()
- insertAtLast(T value)
- contains(T value)
- delete(int index)

Stack : A Stack implementation backed by a LinkedList. The implementation is NOT thread safe implementation and is a very basic demo showcasing the implementation of the following operations on Stack dataStructure :

- push(T value)
- T pop()
- T peek()
- getSize()

Queue : A Queue implementation backed by a LinkedList. The implementation is not threadsafe and should be used accordingly. The supported operations includes the following :

- enQueue(T value)
- deQueue()
- isEmpty()
- getSize()
You can’t perform that action at this time.