Showing posts with label Moderate. Show all posts
Showing posts with label Moderate. Show all posts

Determinant of a matrix in C

Problem
Write a c program to find determinant of a matrix, the size should be variable

Heap Sort

Problem statement
Write a c program to sort numbers using heap sort(using max heap)

Queue implementation using array

Problem statement
Write a c program to implement queue using array 
your program should have these functions 

  1. adding an element to queue
  2. deleting element from queue
  3. printing queue  

Finding k th element by quick sort

Problem statement
Write a c program to find kth element in an array without fully sorting the array
(hint: use quick sort )

Storing numbers in a link list in decreasing order

Problem statement
Write a c program to store numbers in link list in decreasing order,
your program should also print them

Scanning numbers in link list using recursion

Problem statement
Write a c program to recursively add element in a link list
your program should also print them recursively

Printing stack using recursion

Problem statement
Write a c program to print link list using recursion

Storing numbers in link list

Problem statement
Write a c program to store values using link list, your program should store the values in order they are entered and the print the values. total number of inputs will be given by user,
for example
total number of integer you will enter 5
1
2
3
5
1
then your program should print
1
2
3
5
1
and store in the same manner only, i.e. the number which will be entered in the list will be in the last of the list

Storing numbers using link list

Problem statement
Write a c program to store numbers using link list and then print them,the new number entered should be at the top of list

Co-linearity of three points on Cartesian plane

Problem statement 
Write a c Program to check whether three points are collinear or not
and finding the area enclosed by them 

Calculating Volumes of Sphere,cube,Cone using single program


Problem statement
   Problem: Write a 'C' program to find Volumes of:

 i)   Sphere
 ii)  Cube
 iii) Cone

 You need to accept character from user for choice of figure.
 Characters for figure are as 'S' for Sphere, 'C' for Cube and 'D' for Cone.
 According to figure chosen, Accept radius/height/side for figures from user.
 Compute the volume according to the given values and print the volume.

Printing multiplication table

Problem statement
Write a c program to print multiplication table
You should take the inputs from the user.
Do not use any array.

Printing order 9,7 9,5 7 9,3 5 7 9,1 3 5 7 9

Problem statement
Write a c program to print the following series

9
7 9
5 7 9
3 5 7 9
1 3 5 7 9

Calculatinf solution of an equation using Bisection Method

Problem statement
Write a program that uses the bisection algorithm to find  a root of 
the equation x2 − 2 = 0. 
The method of successive bisection works as follows: Start with a lower bound l and an 
upper bound u such that  f(l)*f(u) > 0, ie, f(l) and f(u) are of opposite signs. Then there is 
a foot of f(x) between l and u. Write a loop where in each iteration, you compute the 
middlepoint (mid) of the current interval [l, u]. Evaluate f(mid), and based on the sign of 
f(mid), change the current interval to [l, mid] or to [mid, u]. The loop terminates when 
width of the interval becomes smaller than  10−6

Starting address of words in a line

Problem statement
Write a c program to do the following
Consider the interface of a recursive function:
int wordIndex(char *x, int ind[]).
It takes a string and an int array as parameters.
It returns the word count(i.e. the number of words in that line). The int array after
return will hold the starting indexes of words in
the string.
For Example 
Consider the string
"This string has five words".
Your program should say that this line contains 5 words,and starting address of words are 1,5,...

Finding out SADDLE point

Problem statement
Write a c program to find out saddle point of a metrics
For a given m × n matrix A, the (i, j) the element is said to be a saddle
point if it is the maximum in row i and minimum in column j, or
minimum in row i and maximum in column j.
(a) Write a function int saddle (A, i, j) to test if the (i, j) the element
of the given matrix A is a saddle point or not. Choose the
function prototype in a suitable way, and use additional parameters,
if necessary. If the element is a saddle point, the function
must return 1; if not, it must return 0.
(b) Write a main function that would first read in an m × n matrix
A. Then all the saddle points of the matrix (along with their
positions) would be printed, using the function saddle(). Both
the given matrix and also the output should be printed in properly
formatted form.
(
     For a given m × n matrix A, the (i, j) the element is said to be a saddle
     point if it is the maximum in row i and minimum in column j, or
     minimum in row i and maximum in column j.
)
Run your program for the following two matrices:
7 5 12 17
8 16 9 22
3 20 7 30
5 11 54 20

12 12 12 12 12
12 20 20 20 20
12 5 5 5 5

Decimal to Binary conversion

Problem statement
Write a c program to convert a decimal number to binary number using recursion

Decimal to binary conversion using recursion of an integer

Problem statement
Write a c program to print binary equivalent of an integer number using recursion,your program should not store binary part in any kind of array