Gofrugal
Gofrugal
1) Rotate matrix: Given an image represented by a N*N matrix, where each pixel in the
image is 4 bytes, write a method to rotate the image 90 degrees. Can you do this in
place?
3) Write an algorithm to print all ways of arranging eight queens on an 8*8 chess board so
that none of them share the same row, column, or diagonal. In this case, “diagonal”,
means all diagonals, not just the two that bisect the board.
5) How can you sort the elements of the array in descending order
6) Print n space separated integers such that odd numbers will come after the even
numbers in the list.
7) Write a C program to convert a decimal number to binary and print the count of 1's in
it. If 1's are not present in binary number, then print invalid input.
10) Write a function FindMaxInArray, which finds the largest number in an array with its
index.
The largest number and its index should be printed in separate lines.
Sample Test Cases :
INPUT:
35 42 67 57 11 12 45 94 55 87
OUTPUT:
94
7