Sorting: void bubble_sort(int arr[], int n, unsigned& comparisons, unsigned& swaps); void merge_sort(int arr[], int start, int end, unsigned& comparisons, unsigned& moves);
Q: 4- if y=sin(x), z=cos(x), v=exp(x), could you plot y, z, v as shown below! Figures Figure 1 File…
A: Jjjjhh
Q: 39. In the Logical design process we derive tables and relationships from the conceptual model. When…
A: Here is the explanation regarding the table that is considered parent:
Q: List the six most important factors that prompted you to start learning about compilers.
A: Introduction: Compilers: A compiler modifies a program's type or the language it was written in.…
Q: Do you have a firm grasp on the fundamental aspects of the Compiler Phases? Are there any examples…
A: Compiler phases: The compilation procedure is comprised of numerous separate phases. During each…
Q: What specific kind of computer architecture do smartphones and other mobile devices typically…
A: The phrase "mobile device" refers to any form of portable computer in its broadest sense. These…
Q: n EDX after this code executes?
A: The answer is
Q: 1. The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum…
A: The given question are both multiple choice selected questions as well as true or false selected…
Q: Assess the benefits and drawbacks of both offline batch processing and online data entry. The…
A: Batch data input technique: Advantages: Ideal for managing big data and transaction volumes.…
Q: Each address generated by the CPU is compared to the relocation and limit registers; b) a protection…
A: One of the few data storage areas that are a component of the computer processor is a processor…
Q: 1) Visit any website, and with Wireshark, provide the exact/actual sequence and acknowledgement…
A: Disclaimer: “Since you have asked multiple question, we will solve the first question for you. If…
Q: In what ways would you recommend that workers adopt certain traits? Just how useful are these…
A: Problem-solving style must be followed by organisation employees. It's crucial for employees and…
Q: Create tables, please do add extra columns of your own choice in each table, insert rows and select…
A: List of tables to be created with data type:- Table:- author_tbl id INT auto_increment author…
Q: A manager's ability to compare and comprehend the results of performance analyses depends on the…
A: Performance Result Analysis: The most important and technically challenging part of performance…
Q: Represent the following complex numbers in polar coordinate Z= 2 + 5j Y=-3-3j D=-2 +6j
A:
Q: Which of the following statements are correct? (Select all that applies.) Group of answer choices…
A: Please find the answer below :
Q: When a process fails, most operating systems either a) create a new file, b) notify another active…
A: Introduction A OS is that the program that, once being at first loaded into the pc by a boot…
Q: Below is a rundown of Compiler's primary phases and features. Explain each stage and give an…
A: Given: What are the Phases of Compiler's fundamental features? Please explain each stage using…
Q: When it comes to the information system at your company, what are the biggest difficulties, and what…
A: Information system is a collection of data and informations with applications of hardware, softwares…
Q: rly search x in arr[]. If x is present then return the index, // otherwise return -1 int…
A: Solution - In the given question, we have to do the analysis of Linear search in worst, average, and…
Q: Please use C++ to solve the listed problems in one code 1). Decrypt the following: “DY CVOOZ…
A: The solution is given below for the above-given question:
Q: An effective and precise compiler needs to think about many different things. Explain.
A: An optimizing compiler is a piece of computer software that aims to minimize or enhance certain…
Q: MOVLW 0x25 LOOP DECF BTFSS STATUS, Z…
A: The Delay function which are the models the Laplace expression e-sT, where T is the delay time and s…
Q: What is the definition of metadata? Which part of a database management system is responsible for…
A: Metadata describes tables and fields in a database. DBMS must store and make available Metadata.…
Q: Please do both questions. Thank you in advance. Subject- Security Governance Type 1: Calculation…
A: Answer is attached in step 2 along with explanation
Q: If you want to convince a programmer that deep access is preferable to shallow access, you need to…
A: Introduction: Non-block structured languages use dynamic scope allocation. Runtime activation…
Q: Which ones are correct for the tree T drawn below? (Select all that applies.) look at the picture…
A: Traversals in a tree Preorder Visit the node Traverse the left subtree Traverse the right…
Q: Identify the fallacy in the following argument. A or B A Therefore, not B
A: Prepositional fallacies include this. It is known as this particular fallacy. declaring a disjunct…
Q: For example, what does a perceptron network model entail? How could this model be used for…
A: The model for the training algorithm suggests: A convolution model is a continuous learning strategy…
Q: 3. List the order in which the vertices are visited with a breadth-first search starting with vertex…
A:
Q: In python, draw a flowchart for a program that takes two inputs. If the first input is greater than…
A: - We need to create a flowchart for a python program that takes two input and compute the difference…
Q: How many different kinds of computerized information systems are in widespread use today?
A: The following are the four kinds of computer-based information systems that are utilised most often…
Q: Consider a Python class defined as follows. Note that there might be errors in the definition of…
A: Dear Student, The answer to your question is given below - Here, I have marked each statement as…
Q: For the code in the attached image: 1. Suppose sizeof(struct student) is 16 (decimal) and the start…
A: Here is the explanation regarding the address:
Q: Which operating system, Linux or Windows, do you think has a more approach to operating and managing…
A: Solution: When compared to the operation and maintenance of Linux's virtual memory, Windows' is the…
Q: Why not try out Sun Solaris's user and kernel threading? Can you explain the pros and cons of…
A: Explanation: The Sun Solaris os, a Unix operating system, was created by Solar Micro Systems. The…
Q: a. Consider the prime numbers 7 and 17. Verify that (5, 119) is a correct public key for RSA…
A: RSA algorithm: Step 1: Choose 2 prime numbers p and q. Step 2: Calculate n such that it is the…
Q: { "name": "Renata Severson", "dob": "2017-02-22", "address": { }, "street": "4228 Lucy Circle",…
A: Valid JSON The JSON above is valid Explanation: Proper JSON Format Data is in key-value pairs…
Q: Write a program that inputs a student's name in the following form: lastName, firstName middleName.…
A: - We have to correct the order of name used in the string expression. - We are using c++ here as…
Q: In what ways might data mining be beneficial? In the context of developing software, what is the…
A: Data Mining data mining has been increasingly popular in recent years. It is now utilized by many…
Q: 7. (s) have a randomized algorithm that finds a solution to a problem with probability .01 every…
A: Randomized algorithms are algorithms that can make random choices (e.gthose obtained by tossing…
Q: I was wondering why so many people are switching to games designed for non-standard PC…
A: Gaming apps are mostly utilised in large numbers. Alternative Computer Architectures exist because…
Q: please help me fast and I will Mark you System authentication system circuit Arduino and RFID and…
A: In the last post, you learned how to use Arduino to make an RFID and keypad-based door lock and…
Q: Show the array [2, 4, 1, 5. 31 after the for loop in pancake_sort executes once. What is the…
A: The answers from the above programming questions are given below:
Q: What are the downfalls of the OSI model?
A: First, you must detail how the OSI Model falls short. The standards established by the OSI model…
Q: java Codes to demonstrates the use of queues to encrypt and decrypt messages.
A: Codes to demonstrates the use of queues to encrypt and decrypt messages:
Q: Why is it important to weigh the pros and cons of using distributed data processing before…
A: These question answer is as follows,
Q: Show a step-by-step solution. Solution must be correct. Provide a Regular expression for the…
A: The solution is given in the next steps.
Q: How many edges does a tree with 5000 vertices have?
A: Each tree with n vertices has n-1 edges as a result. Graphs with n-1 edges without cycles or…
Q: inserted in the [1,2,3,4,5,6]
A: A binary search tree can be denoted as a binary tree in which the left elements to the root are…
Q: In what ways might data mining be beneficial? In the context of developing software, what is the…
A: The concepts of cohesion and coupling: The term "coupling" refers to the interactions between…
This sorting function and the merge one is very similar can someone help please? its in C++
Step by step
Solved in 3 steps with 1 images
This is very helpful thank you, the code I came up with is this but I am not sure how to finish it
void bubble_sort(int arr[], int n, unsigned& comparison, unsigned& swaps) {
if (arr[n]==1) {
comparison++
}
else if (n > n+1) {
swap(n, n-1)
}
and
void merge_sort(int arr[], int start, int end, unsigned& comparison, unsigned& moves) {
if (arr[n] % 2 ==0) {
arr[n] / 2
}
- Median Function – In statistics, the median of a set of values is the value that lies in the middle when the values are arranged in sorted order. If the set has an even number of values, the median is the average of the two middle values. Your program should start with two arrays of integers containing the following values: Even numbered array: 17 32 45 68 99 101 67 89 22 27 Odd numbered array: 17 32 45 68 99 101 67 89 22 Using a sort function of your choice, first sort the arrays. NOTE: you may use the Standard Template Library sort function or your own sort function. Then, write a function that determines the median of a sorted array. The function should take an array of numbers and an integer indicating the size of the array and return the median of the values in the array. The same function should be called twice – once for the even array and once for the odd array. Your program should also have a printArray function that can be used to print the sorted array. (It…test_var = 'AAMMTTMT';//test_var is testing variable takenarray = test_var.split('');//string is split into the array function SWAP(TAM, i, j)//function to swap{temp = TAM[i];TAM[i] = TAM[j];TAM[j] = temp;}function sort_AMT(TAMUK)//function to sort the array{for(i = 0; i<TAMUK.length;i++){for(j = 0; j<TAMUK.length-1;j++){if(TAMUK[i]<TAMUK[j])SWAP(TAMUK,i,j);}}console.log(TAMUK);} sort_AMT(array);//function call Can I have this program output and code in HTML page?test_var = 'AAMMTTMT';//test_var is testing variable takenarray = test_var.split('');//string is split into the array function SWAP(TAM, i, j)//function to swap{temp = TAM[i];TAM[i] = TAM[j];TAM[j] = temp;}function sort_AMT(TAMUK)//function to sort the array{for(i = 0; i<TAMUK.length;i++){for(j = 0; j<TAMUK.length-1;j++){if(TAMUK[i]<TAMUK[j])SWAP(TAMUK,i,j);}}console.log(TAMUK);} sort_AMT(array);//function call How to write an HTML code for this javascript result/output? where the result will be displayed in HTML page.
- In C++: Trace all the passes for the selection sort on the array: {22, 65, 9, 15, 55, 27, 33, 45}TRUE OR FALSE You should not pass a one-dimensional array to a function. Passing an array by reference is more efficient than passing it by value. The quick sort algorithm provides a quick and easy way to sort the items stored in an array, as long as the number of items is relatively small—for example, fewer than 50. The variables in an array may be stored in non-consecutive memory locations in the computer’s internal memory. It takes longer for the computer to access the information stored in a disk file, than in an array in memory.Q: Integrate time function in insertion sort code and check time for 50,100 and 250 values Question: Inserting Sort #include<iostream>using namespace std;//swappingvoid swapping(int &a, int &b) { //variable declaration int temp;//swapping temp = a; a = b; b = temp;}//to display the arrayvoid display(int *array, int s) { //Loop for(int x = 0; x<s; x++) //Creating the array cout << array[x] << " "; cout << endl;}//Performing the selectionSortvoid selectionSort(int *array, int s) { //variable declaration int x, j, min; //loop for(x = 0; x<s-1; x++) { //used to minimum data min = x; for(j = x+1; j<s; j++) if(array[j] < array[min]) min = j; //placing the value swap(array[x], array[min]); }}//main of the codeint main() { //variable declaration int n; //input cout << "Enter the number of elements: "; //Storing the input cin >> n;…
- param data * @return true if all items of the array are positive (more than 0), false otherwise. * return false if the array is null. */ public boolean allPositives(int[] data) without using functionsReverse ArrayWrite a function that accepts an int array and the array’s size as arguments. The function should create a copy of the array, except that the element values should be reversedin the copy. The function should return a pointer to the new array. Demonstrate thefunction in a complete program.Movie Data Write a program that will be used to gather statistical data about the number of movies college students see in a month. The program should ask the user how many students were surveyed and dynamically allocate an array of that size. The program then should allow the user to enter the number of movies each student has seen. It should then sort the scores and calculate the average. Modularity: Main: The main function should accept the number of students from the user and dynamically create an array large enough to contain number of movies watched for each student. Input validation: The number of students should be a positive integer. Print the average and free the allocated array when complete. Get the data: This function should get the number of movies watched by each college student. Input validation: The number of movies should be a positive integer. Sort the data: This function should sort the array in ascending order. Note you may use the Standard Template Library sort…
- Exercise 1: //The max function the max between a and b, it returns a if a == //b public double max(double a, double b); //The mult function returns the result of a * b public double mult(double a, double b); //The exist in array function returns the index of the element //‘a’ if //‘a’ exist in array ‘arr’ otherwise returns ‘-1’ public int existsInArray(int [] arr, int a); //Are array equals method compares two arrays and returns true // if the elements of array ‘a’ are equal to elements of array // ‘b’, element by element. If equals it returns 0, it returns - // 1 if not public int areArrayEquals(int [] a, int [] b); Devise four executable test cases for every method in the JUnit notation. See the attached handout for a refresher on the notation.Finding the common members of two dynamic arrays: Write a program that first reads two arrays and then finds their common members (intersection). The program should first read an integer for the size of the array and then should create the two arrays dynamically (using new) and should read the numbers into array1 and array2 and then should find the common members and show it. Note: The list of the common members should be unique. That is no member should be listed more than once. Tip: A simple for loop is needed on one of the arrays (like array1) and one inner for loop for on array2. Then for each member of array1, if we find any matching member in array2, we record it. Sample run: Enter the number of elements of array 1: 7 Enter the elements of array 1: 10 12 13 10 14 15 12 Enter the number of elements of array 2: 5 Enter the elements of array 2: 17 12 10 19 12 The common members of array1 and array2 are: 12 10ARRAY RANDOMIZER Create a program that shuffels all the elements present in an array. To shuffle an array, you need to do at least 500 random swaps of any elements in the array given below. Print the shuffled array in the output. {12, 54, 22, 100, -3, 5, 10, -33, 78, 90, 29, -45, 77, -9, 19, 21} Language: CPP