Given an array of numbers, find GCD of the array elements. In a previous post we find GCD of two number.
Examples:
Input : arr[] = {1, 2, 3}
Output : 1
Input : arr...
Share
Given a singly linked list, find middle of the linked list. For example, if given linked list is 1->2->3->4->5 then output should be 3.
If there are ev...
Share
Given a 2D array, print it in spiral form. See the following examples.
Examples:
Input:
1 2 3 4
5 6 7 8
9 10 11 12
...
Share