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

Which of the following civilization is associated with 'Achaemenid Empire'?

A) Chinese Civilization B) Iranian Civilization
C) Egyptian Civilization D) Arab Civilization
 
Answer & Explanation Answer: B) Iranian Civilization

Explanation:

In the middle of the 6th centuryB.C, a powerful empire was established in Iran this empire which lasted over two centuries is known as the Achaemenid Empire. The founder of this Empire was Cyrus with his capital at pasargadae. In 539 B.C, cyrus defeated the Babylonians and extended his empire over a vast territory up to Asia Miner. His successor was Darius I (522-486 B.C).

Report Error

View Answer Report Error Discuss

Filed Under: World History

0 2679
Q:

In the following question, a sentence has been given in Active/Passive voice. Out of the four alternatives suggested, select the one which best
expresses the same sentence in Passive/Active voice.
People drink champagne on New Year’s Eve.

A) Drinking of champagne is done on New Year's Eve. B) New Year's Eve was the day when People drank Champagne.
C) People on Eve of New Year drink champagne. D) Champagne is drunk on New Year’s Eve.
 
Answer & Explanation Answer: D) Champagne is drunk on New Year’s Eve.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English

0 2679
Q:

Which country won the Cricket World cup in 2011

A) Sri Lanka B) Australia
C) Pakistan D) India
 
Answer & Explanation Answer: D) India

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Sports

2 2677
Q:

Project Time Management - Processes

Describe the Inputs, Tools and Techniques, Outputs of Activity Definition ?

Answer

I. Inputs



  • Enterprise environmental factors

  • Organizational process assets

  • Project scope statement

  • Work breakdown structure

  • WBS dictionary

  • Project management plan


II. Tools and Techniques



  • Decomposition

  • Templates

  • Rolling wave planning

  • Expert judgment

  • Planning component


III. Outputs



  • Activity list

  • Activity attributes

  • Milestone list

  • Requested changes

Report Error

View answer Workspace Report Error Discuss

0 2677
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 2677
Q:

The greenhouse effect is caused solely by human activity.

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:

True, the greenhouse effect is caused solely by human activities such as deforrestation, depletion of natural resources and emission of CO2 by using vehicles, refrigerators and AC's.

Report Error

View Answer Workspace Report Error Discuss

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

1 2676
Q:

Promotions and promotion mix :

What about the budget? We want our promotional campaigns to be cost effective enough. I don’t think we can afford celebrity endorsements as of now!

Answer

No problem. We can use network marketing as an alternative. The company already has its strong network of customers who can spread the word about its products. They can encourage referral rewards for say every three customers who will buy our product or avail our service.


We can also announce a contest for the customers to buy the product and win a chance to get himself broadcasted for the product advertisement. We can ask them to send in their photo along with the contest application form which they get alongwith the product they buy. So we don’t have to pay them as we would otherwise have to pay to a celebrity.

Report Error

View answer Workspace Report Error Discuss

0 2676