What do you want to save?
Add Code snippet
New code examples
-
C 2021-11-18 05:59:19
optimal page replacement algorithm to find page fault
#include<stdio.h> int main() { int no_of_frames, no_of_pages, frames[10], pages[30], temp[10], flag1, flag2, flag3, i, j, k, pos, max, faults = 0; printf("Enter number of frames: "); ... Add solution -
Other 2021-11-18 04:40:28
iterative segment tree codeforces
const int N = 1e5; // limit for array size int n; // array size int t[2 * N]; void build() { // build the tree for (int i = n - 1; i > 0; --i) t[i] = t[i<<1] + t[i<<1|1]; } void modify(int p, int value) { // set value at position p ... Add solution -
C 2021-11-17 18:10:17
C program to calculate the sum of odd and even numbers
#include <stdio.h>void main(){int i, number, odd_sum = 0, even_sum = 0;printf("Enter the value of number\n");scanf("%d", &number);for (i = 1; i <= number; i++){if (i % 2 == 0)even_sum = even_sum + i;elseodd_sum = odd_sum +... Add solution -
Other 2021-11-16 12:17:10
Dijkstra’s Algorithm code in C
#include<stdio.h>#include<conio.h>#define INFINITY 9999#define MAX 10 void dijikstra(int G[MAX][MAX], int n, int startnode); void main(){ int G[MAX][MAX], i, j, n, u; clrscr(); printf("\nEnter the no. of vertices:: "); scan... Add solution -
Python 2021-11-16 09:00:17
prims minimum spanning tree
#include<stdio.h> #include<conio.h> int a,b,u,v,n,i,j,ne=1; int visited[10]= { 0},min,mincost=0,cost[10][10]; void main() { clrscr(); printf("\n Enter the number of nodes:"); scanf("%d",&n); printf("\n Enter th... Add solution