C++ program that uses dynamic programming algorithm to solve the optimal binary search tree problem

Thursday, March 11th, 2010  »  Posted By  »  Total 2 Comments

/* Write a C++ program that uses dynamic programming algorithm to solve the optimal binary search tree problem */ #include<iostream> #include<conio.h> #include<stdio.h> using namespace std; #define MAX 10 int find(int i,int j); void print(int,int); int p[MAX],q[MAX],w[10][10],c[10][10],r[10][10],i,j,k,n,m; char idnt[7][10];   main() { cout << "enter the no, of identifiers"; cin >>n; cout <<"enter identifiers"; for(i=1;i<=n;i++) gets(idnt[i]); […]

C++ program to implement dynamic programming algorithm to solve the all pairs shortest path problem

Thursday, March 11th, 2010  »  Posted By  »  Total 7 Comments

/* Write a C++ program to implement dynamic programming algorithm to solve the all pairs shortest path problem */ #include<iostream> #include<conio.h> using namespace std; int min(int a,int b); int cost[10][10],a[10][10],i,j,k,c;   main() { int n,m; cout <<"enter no of vertices"; cin >> n; cout <<"enter no od edges"; cin >> m; cout<<"enter the\nEDGE Cost\n"; for(k=1;k<=m;k++) […]

C Program to implement the midpoint circle drawing algorithm

Friday, October 2nd, 2009  »  Posted By  »  Total 9 Comments

C Program to implement the midpoint circle drawing algorithm to draw a circle. Modify the algorithm toimplement specified arc or sector.

C program for SJF CPU Scheduling Algorithm

Sunday, September 20th, 2009  »  Posted By  »  Total 82 Comments

OUTPUT:
enter no of processes: 5

enter process1 name: aaa
enter process time: 4
enter process2 name: bbb
enter process time: 3
enter process3 name: ccc
enter process time: 2
enter process4 name: ddd
enter process time: 5
enter process5 name: eee
enter process time: 1

C program for LRU page replacement algorithm

Saturday, September 19th, 2009  »  Posted By  »  Total 24 Comments

OUTPUT :
2 -1 -1
2 3 -1
2 3 -1
2 3 1
2 5 1
2 5 1
2 5 4
2 5 4
3 5 4
3 5 2
3 5 2
3 5 2
no of page faults : 4

Program for FIFO page replacement algorithm

Saturday, September 19th, 2009  »  Posted By  »  Total 26 Comments

OUTPUT :
2 -1 -1
2 3 -1
2 3 -1
2 3 1
5 3 1
5 2 1
5 2 4
5 2 4
3 2 4
3 2 4
3 5 4
3 5 2

Number of page faults : 6

Program for Deadlock detection algorithm

Saturday, September 19th, 2009  »  Posted By  »  Total 26 Comments

INPUT: enter total no. of processes : 4 enter claim matrix : 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 1 0 1 enter allocation matrix : 1 0 1 1 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 […]

Insertion sort in C program

Insertion sort in C program Thursday, December 4th, 2008  »  Posted By  »  Total 189 Comments

Here is the program to sort the given integer in ascending order using insertion sort method. Please find the pictorial tutor of the insertion sorting. Logic : Here, sorting takes place by inserting a particular element at the appropriate position, that’s why the name-  insertion sorting. In the First iteration, second element A[1] is compared […]

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: