C Programming – Replace all ‘0’ with ‘5’ in an input Integer – Mathematical Algorithms – The idea is simple, we get the last digit using mod operator ‘%’.
array programming
C Programming Draw a circle without floating point arithmetic – Mathematical Algorithms – Following program uses a simple concept Let the radius be r.
Find the two non-repeating elements in an array of repeating elements – Bit Algorithm – Given an array in which all numbers except two are repeated once.
C Programming – Given a number, find the next smallest palindrome – Mathematical Algorithms – For example, if the input number is “2 3 5 4 5”.
C++ Programming for Suffix Array Set 1 Introduction – Searching and sorting – A suffix array is a sorted array of all suffixes of a given string.
C Programming for Suffix Array Set 1 Introduction – Searching and sorting – A suffix array is a sorted array of all suffixes of a given string.
Longest Even Length Substring such that Sum of First and Second Half is same – Searching and Sorting – Given a string ‘str’ of digits, find length of the longest substring of ‘str’, such that the length of the substring is 2k digits.
C Program Count 1’s in a sorted binary array – Searching and Sorting – A simple solution is to linearly traverse the array. The time complexity of the simple solution is O(n). We can use Binary Search to find count in O(Logn) time.
JAVA Program Count 1’s in a sorted binary array – Searching and Sorting – A simple solution is to linearly traverse the array. The time complexity of the simple solution is O(n). We can use Binary Search to find count in O(Logn) time.