Collections of coding problems solved apart from the usual in Algorithms repo
Problem 1: Rearrange positive and Negative numbers at alternate poistions in an array in O(N) time complexity and O(1) space complexity.
Program 1: Does not retain the order of the elements in the array Program 2: Retains the order of the elements in the array
Program 1 ("clockwiseMethod1") : In this program, we rotate the matrix by 90 degrees in clockwise direction using an inplace method.
Program 2 ("AntiClockwiseMethod1") : In this program, we rotate the matrix by 90 degress in anticlockwise direction using an inplace method.
Program 3 ("clockwiseMethod2") : In this program, we rotate the matrix by 90 degrees in clockwise direction by rotating first along the primary diagonal and then, rotating along the central axis of columns.
Program 3 ("clockwiseMethod3") : In this program, we rotate the matrix by 90 degrees in clockwise direction by rotating first along the secondary diagonal and then, rotating along the central axis of rows.