Welcome

KU 6TH SEM PRACTICAL SOLUTIONS

Set -1
1. Write a program for frame sorting technique used in buffers.
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct frame
{
       int fslno;
       char finfo[20];
};
struct frame arr[10];
int n;
void sort()
{
       int i,j,ex;
       struct frame temp;
       for(i=0;i<n;i++)
       {
              ex=0;
              for(j=0;j<n-i-1;j++)
              if(arr[j].fslno>arr[j+1].fslno)
              {
                     temp=arr[j];
                     arr[j]=arr[j+1];
                     arr[j+1]=temp;
                     ex++;
              }
              if(ex==0) break;
       }
}