Given an unsigned integer, swap all odd bits with even bits. For example, if the given number is 23 (00010111), it should be converted to 43 (00101011).
C Programming – Find if there is a path between two vertices in a directed graph – check whether there is a path from the first given vertex to second.
C Programming-Backtracking Set 1 (The Knight’s tour problem) – Backtracking – Backtracking is an algorithmic paradigm that tries different solutions until finds a solution that “works”. Problems which are typically solved using backtracking technique have following property in common.
C Programming-Print all possible strings that can be made by placing spaces – Searching and Sorting – The idea is to use recursion and create a buffer.
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.