1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
shepuryov [24]
3 years ago
8

int foo(int A[], int left, int right){ int i, x, q, N; if(right <= left) return 1; x = 0; for(i=left; i <= right; i++) x +

= A[i] % 2; // busy work... N = right-left+1; q = left + (N/3); return x + foo(A, left, q) + foo(A, q+1, right);
Computers and Technology
1 answer:
sineoko [7]3 years ago
3 0

Answer:

quicksort.cpp

void quickSort(int arr[], int left, int right) {

     int i = left, j = right;

     int tmp;

     int pivot = arr[(left + right) / 2];

 

     /* partition */

     while (i <= j) {

           while (arr[i] < pivot)

                 i++;

           while (arr[j] > pivot)

                 j--;

           if (i <= j) {

                 tmp = arr[i];

                 arr[i] = arr[j];

                 arr[j] = tmp;

                 i++;

                 j--;

           }

     };

 

     /* recursion */

     if (left < j)

           quickSort(arr, left, j);

     if (i < right)

           quickSort(arr, i, right);

}

You might be interested in
To achieve balance—that is, to operate an information system that satisfies the user and the security professional—the security
marta [7]

the answer is True

there has to be a balance between security and the user experience

7 0
3 years ago
Write a demo test to verify the above Rectangle object accessible from demo test main program and can execute display() method t
Sati [7]

Answer:

Explanation:

The Rectangle class was not provided in this question but after a quick online search I was able to find the class code. Due to this I was able to create a test code in the main Method of my program to create a Rectangle object and call it's display() method. The Test code and the output can be seen in the attached image below. While the code below is simply the Main Test Program as requested.

class Brainly {  

   public static void main(String[] args) {

       Rectangle rectangle = new Rectangle(20, 8);

       rectangle.display();

   }

}

4 0
2 years ago
Call 334-399-4201 to annoyed my mom
yaroslaw [1]

Answer: why...

Explanation:

3 0
3 years ago
What is htc one mseven​
Tamiku [17]

"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"

8 0
2 years ago
Is a class of software used to meet organization-wide business needs and typically shares data with other enterprise application
yuradex [85]

Answer:enterprise

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following string
    9·1 answer
  • You are to create a program using Python that asks the user for a nonnegative number, then computes the mean and variance using
    15·1 answer
  • A ______ connection provides fast internet service and the ability to exchange large files. ​
    11·1 answer
  • What problem with internal hardware components is similar to unplugged
    6·2 answers
  • Which approach to knowledge management capitalizes on tacit knowledge and requires heavy IT investment?
    7·1 answer
  • Suppose end system A wants to send a large file to end system B. At a very high level, describe how end system A creates packets
    7·1 answer
  • Vghfthcnbvhghvngjgjvjgkb, kcnjc cnnfjdhd mc Dan Jfhjc cm. Cm n n hdjfjocnkcnd
    10·2 answers
  • Writing in Java, write a program that prompts the user to input an integer and then outputs both the individual digits of the nu
    15·1 answer
  • The elements in a long array of integers are roughly sorted in decreasing order. No more than 5 percent of the elements are out
    12·1 answer
  • Any idea how to make my simple python projects such as guess the number, mad libs, etc. even better?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!