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 2756
Q:

Genes are made of 

A) Carbohydrates B) Proteins
C) Fats D) Nucleotides
 
Answer & Explanation Answer: D) Nucleotides

Explanation:

Genes : The DNA is the genetic material. The DNA is made of several nucleotides. A nucleotide means, one nitrogenous base one sugar molecule and a phosphate molecule. These nucleotides occur in sequences and several nucleotides form one Gene ( a functional mgene is called a cistron)

Report Error

View Answer Report Error Discuss

Filed Under: Biology

7 2756
Q:

Who is the new president and CEO of Nokia?

Answer

Rajeev Suri

Report Error

View answer Workspace Report Error Discuss

2 2756
Q:

Which of the following Articles of Indian Constitution guarantees freedom to press?

A) Article 16 B) Article 19
C) Article 22 D) Article 31
 
Answer & Explanation Answer: B) Article 19

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics

1 2756
Q:

How many Species go Extinct Every Day?

Answer

About 150 - 200 species of plant, insect, bird and mammal become extinct every day or 24 hrs.


This is not an accurate but an estimation by U.N. Convention on Biological Diversity and Global Extinction Rates. It is also said that current extinctions were 'up to 100 times higher than the background rate.'

Report Error

View answer Workspace Report Error Discuss

Subject: General Science Exam Prep: AIEEE , Bank Exams
Job Role: Analyst , Bank Clerk

6 2756
Q:

What are the Various Register in 8085?

Answer

Accumulator register, Temporary register, Instruction register, Stack Pointer, Program Counter are the various registers in 8085

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

0 2755
Q:

Self pollination will lead to

A) Inbreeding B) Over breeding
C) Outbreeding D) Rare breeding
 
Answer & Explanation Answer: A) Inbreeding

Explanation:

Self pollination occurs in the flowers when the pollen grains of the flower falls on the stigma of the same due to wind or insects like moths and bees. This lead to the inbreeding.

Report Error

View Answer Report Error Discuss

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

1 2755
Q:

The given sentences, when properly sequenced, form a coherent paragraph. Each sentence is labelled with a letter. Choose the most logical order of the sentences from among the five given choices to construct a coherent paragraph keeping 1 as the first statement.

1) For first-time Indian travellers, stepping out of the airport in Singapore or Japan is a momentous, potentially mindset-changing experience.

A) But walk in a cramped gully in Delhi or even on the main road and everything that is not desirable inside, finds its way outside.

B) Public littering is a social issue that results in massive aesthetic, financial and health- related costs for India. It’s not as if we don’t value cleanliness. Our homes are the textbook definition of clean.

C) How does that compare with our paan- stained buses filled with peanut shells?

D) How can bustling cities packed with people be so spotless? As far as the eye can go, there is not a single piece of stray paper on the road or in public transport.

A) BCAD B) DCBA
C) DBCA D) ADBC
 
Answer & Explanation Answer: B) DCBA

Explanation:

The correct sequence is DCBA.

Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

1 2754