Questions

Q:

Write a c program for quick sort.

Answer

#include<stdio.h>

void quicksort(int [10],int,int);

int main(){
  int x[20],size,i;

  printf("Enter size of the array: ");
  scanf("%d",&size);

  printf("Enter %d elements: ",size);
  for(i=0;i<size;i++)
    scanf("%d",&x[i]);

  quicksort(x,0,size-1);

  printf("Sorted elements: ");
  for(i=0;i<size;i++)
    printf(" %d",x[i]);

  return 0;
}

void quicksort(int x[10],int first,int last){
    int pivot,j,temp,i;

     if(first<last){
         pivot=first;
         i=first;
         j=last;

         while(i<j){
             while(x[i]<=x[pivot]&&i<last)
                 i++;
             while(x[j]>x[pivot])
                 j--;
             if(i<j){
                 temp=x[i];
                  x[i]=x[j];
                  x[j]=temp;
             }
         }

         temp=x[pivot];
         x[pivot]=x[j];
         x[j]=temp;
         quicksort(x,first,j-1);
         quicksort(x,j+1,last);

    }
}

Output:
Enter size of the array: 5
Enter 5 elements: 3 8 0 1 2
Sorted elements: 0 1 2 3 8

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2830
Q:

When was Bank of Central African State formed

A) 1974 B) 1978
C) 1973 D) 1979
 
Answer & Explanation Answer: C) 1973

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

0 2830
Q:

Select the synonym of
maestro

A) neophyte B) catechumen
C) sophomore D) conductor
 
Answer & Explanation Answer: D) conductor

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2830
Q:

In a projectile motion, a large angle with the horizontal produces ______.

A) flat trajectory B) curve trajectory
C) straight trajectory D) high trajectory
 
Answer & Explanation Answer: D) high trajectory

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Physics
Exam Prep: Bank Exams , CAT

0 2829
Q:

The PCl5 molecule has trigonal bipyramidal structure. Therefore,the hybridization of p orbitals should be

A) sp2 B) sp3
C) dsp2 D) dsp3
 
Answer & Explanation Answer: D) dsp3

Explanation:

The P atom needs five orbitals to form the five P-Cl bonds. It has a 3s and three 3p orbitals, so it must use one of its 3d orbitals to form the fifth bond. These orbitals are hybridized to form five sp3d orbitals that just happen to point in the right directions to form a trigonal bipyramid.

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: Bank Exams

0 2829
Q:

A simple rule concerning water and electrolyte regulation is

A) water passively follows salt B) salt actively follows water
C) water actively follows salt D) salt passively follows water
 
Answer & Explanation Answer: A) water passively follows salt

Explanation:

A simple rule concerning water and electrolyte regulation is water passively follows salt.

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

2 2828
Q:

Read the passage carefully and choose the best answer to each question out of the four alternatives and click the button corresponding to it.


Fever in the season of dengue is sending Calcuttans scurrying to hospitals for admission, triggering a shortage of beds that has forced some private health care institutes to even postpone planned surgeries. Apollo Gleneagles Hospitals on the Bypass had 504 patients in its care as on Thursday of whom 70 had been admitted with fever. Belle Vue Clinic had 180 patients, 32 of them with dengue. Calcutta Medical Research Institute had 350 patients 60 of them with fever.

The number of people admitted for treatment of fever caused by dengue or any undiagnosed illness has been rising every day across hospitals for more than a fortnight.

"There has been heavy pressure on all private hospitals for admission of dengue and cases of unknown fever since the beginning of August. Now it is a surge," said Pradip Tondon, President of the Association of Hospitals of Eastern India.

In July, four to five patients were getting admitted with fever on an average in every hospital. The number has since ballooned with the Calcutta Municipal Corporation apparently in denial about the extent of the dengue outbreak and the Government focused on playing down the threat.

Such has been the rush of patients with fever that some hospitals are calling up people to postpone admissions planned in advance, mostly for surgeries. "We have told many people to come only when we call them to confirm availability of beds," said an official at Belle Vue.


The word 'ballooned' implies

A) playing with balloons B) decreased
C) increased tremendously D) increased slightly
 
Answer & Explanation Answer: C) increased tremendously

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2828
Q:

When backed by buying, power wants become

A) demands B) physical needs
C) exchanges D) social needs
 
Answer & Explanation Answer: A) demands

Explanation:

When backed by buying, power wants become demands. 

Report Error

View Answer Report Error Discuss

Filed Under: Marketing and Sales
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

1 2828