Question: Resoudre 02:52 Sam. 7 dec. . . . 41% O > AA uottawa.brightspace.com C + 5 DSERIE NOIRE... x Questionnair... DZI Questionnair... *Demarrage *Demarrage ccueil

Resoudre

Resoudre 02:52 Sam. 7 dec. . . . 41% O "> AA
02:52 Sam. 7 dec. . . . 41% O "> AA uottawa.brightspace.com C + 5 DSERIE NOIRE... x Questionnair... DZI Questionnair... *Demarrage *Demarrage ccueil | Mic... I... Assignment 4 PArt B Fall 2024 23:54:50 restant X Question 1 (1 point) The following Java code implements the bubble sort algorithm. However, one line has been added (identified by /******/) that causes the code to terminate prematurely. The array below is used as an input. Give the sum of the first 4 elements of this array after the execution of this code. int data [7]= {20, 600, 90, 930, 9, 300, 4}; void bubbleSort (int data ) { int n = data. length; for (int i = 0; i data [j+1]) { // swap data [j+1] and data[j] int temp = data[j]; data [j] = data[j+1]; data [j+1] = temp; swapped = true; } if ( swapped == false) break; Votre reponse: Reponse Question 2 (1 point) For your reference only, here is a code for mergesort. public class MergeSort{ private static void merge (Comparable a, Comparable aux, int lo, int mid, int hil

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Law Questions!