make flowchart for this one plz   #include int sortingbook(int array[], int N) {  int count = 0, i , j , k , minimum , index , flag = 0;  for(i=0;ii ; k--)  //shifting one position to the right from index to i    array[k] = array[k-1];    if(array[i]!=minimum)    count++;  //if the value of min chganged from previous assumption    array[i] = minimum;  }  return count; } int main() {  int array[20],i,N,c;  printf("\nEnter number of books(N) : ");  scanf("%d",&N);  //number of books  printf("\nEntercurrent sequence of  %d books :  \n=>   ",N);  for(i=0;i  ");  for(i=0;i

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

make flowchart for this one plz

 

#include<stdio.h>
int sortingbook(int array[], int N)
{
 int count = 0, i , j , k , minimum , index , flag = 0;
 for(i=0;i<N;i++)
 {
  minimum = array[i];   //ith element as the minimum
  index = i;          //setting index value as i
  for( j = i; j < N; j++)
  {
   if(array[j] < minimum)
   {
    minimum = array[j];  //calculating minimum
    index = j;     //assigning the minimum position into index
   }
  }
  for(k = index; k>i ; k--)  //shifting one position to the right from index to i
   array[k] = array[k-1]; 
  if(array[i]!=minimum)
   count++;  //if the value of min chganged from previous assumption 
  array[i] = minimum;

 }
 return count;
}
int main()
{
 int array[20],i,N,c;
 printf("\nEnter number of books(N) : ");
 scanf("%d",&N);  //number of books
 printf("\nEntercurrent sequence of  %d books :  \n=>   ",N);
 for(i=0;i<N;i++)
  scanf("%d",&array[i]);  //reading  sqeuence 
 c = sortingbook(array,N);
 printf("\nSorted sequence is :\n=>  ");
 for(i=0;i<N;i++)  //printing final sequence
  printf("%4d",array[i]);
 printf("\nThe minimum number of moves required for sorting : %d\n",c);
 return 0;
}

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY