Write a program to sort an array as follows. a. Use insertion sort to sort the array. Print the number of comparisons and the number of item movements. b. Use Shellsort to sort the array using the function shellSort given in this chapter. Print the number of comparisons and the number of item movements. c. Test your program on a list of 1,000 elements and on a list of 10,000 elements.
Q: Read three integers from user input without a prompt. Then, print the product of those integers. Ex:…
A: 1) Since you have not specified programming language, I have written program in python language. 2)…
Q: Suppose an error occurs in a block of ciphertext on transmission using CBC. What effect is produced…
A: Answer is
Q: What is the line complexity of k-means algorithm explain.
A:
Q: Create a 2D board game using java AWT and mouse event. Original and simple example please!
A: import java.awt.Color; import java.awt.FlowLayout; import java.awt.Graphics; import…
Q: n², n, 1, log₂ n, (3/2), n³, n log₂ n, 2n
A: The question has been answered in step2
Q: Instructions JAVA LANGUAGE The Factory Method pattern provides an interface for creating objects in…
A: The java program is given below:
Q: *Python programming 4. How can you print the first parameter inside a function with two…
A: The question answer is as follows,
Q: ppose an even parity code is used to send a message across a noisy channel. Wh ntain at least one…
A: Note: Due to company policies I am compelled to solve only one question and that is the first…
Q: II. Pushdown Automata. Draw a PDA that recognizes the following languages. All machines should be…
A: In this question we will answer about PDA.
Q: Answer in linux pleass 1 ques 2 parts Part 1: What command can I use to add these two files together…
A: To answer this question one needs to have conceptual knowledge of the various applications of the…
Q: II. Pushdown Automata. Draw a PDA that recognizes the following languages. All machines should be…
A: Answer: We have drawn the PDA for the given Language and we have explain each and every point…
Q: Add a foreign key constraint to the movie table: the column prod_id is the foreign key, referencing…
A: ALTER TABLE movieADD prod_id INTEGER,ADD CONSTRAINT FOREIGN KEY(prod_id) REFERENCES production(id);
Q: 1. Create a selection sort program and upload your file here. 2. Screenshot your sorted output after…
A: The C code is given below with code and output screenshot Happy to help you ?
Q: Hi, I need help with this in Java. Thank you! Write a method named sum100 that returns the sum of…
A: Solution : The sum100 method for loop is used to compute the sum of integers ranging from 1 to 100…
Q: 3. Given F(A,B,C,D,E) = TM (0,3,6,9,11,19,20,24,25,26,27,28,20,30). TTD (1,2,12,13). Find two…
A: 3.
Q: n Python, grades_dict = {'Wally': [87,96,70], 'Eva': [100,87,90], 'Sam': [94,77,90], 'Katie':…
A: PYTHON : 1.simple,easy to use 2.No memory leak 3.Interpreted 4.Free and Open source 5.Object…
Q: Explain bag of words model.
A:
Q: fill.cpp
A: After completing the code, I have provided C++ CODE along with OUTPUT…
Q: In a 0-1 knapsack problem, how could you implement a repair mutation to transform infeasible…
A: In the 0-1 knapsack problem, we have some items which have some weight or profits. We have to put…
Q: can you use Raptor program?
A: I attached your answer below.
Q: What is the one’s complement of negative - 19
A: We need to find the one’s complement of negative - 19.
Q: 1.3.consinder Machine in IEEE Single-precision floating point format…
A: Dear learner, hope you are doing well, I will try my best to answer this question. Thank You!!!!
Q: 1.1 Convert the decimal number 43 into a binary number. 1.2 Convert the decimal number 0.35 into a…
A: In this question we have been given some decimal numbers and we need to convert them into binary…
Q: Exercise: 1) Design a class ComboLock that works like the combination lock in a gym locker, as shown…
A: We need to write a Java code for the given scenario. ***Only 1st 3 questions are answered. For…
Q: in PYTHON PLEASE 8) Given the following code: list1 = [1, 2, 3] list2 = list1 list3 = [list1,…
A: Solution: Required language is python:
Q: Theory of Computation Give 2 strings which aren't in this language recognized by the PDA
A: Given that, Set of states= {q1, q2, q3, q4, q5, q6, q7} Set of input alphabets= {a, b, c} Input…
Q: What is a nonce?
A:
Q: Welcome to ADVISE! SIGN IN Username (School email): Password (A#): SIGN IN CANCEL
A: Answer: WE have done code in HTML and CSS based on the given layout of Registration form and also we…
Q: what interpreter are you using to run that code? are you doing anything special to make it work?
A: Description:- MIPS gcc 12.2.0 is a compiler for running assembly language.
Q: For each of the following recurrences, apply the Master Method to find its asymptotic solution. Y…
A:
Q: What is Soft Systems Methodology (SSM) ?
A:
Q: List three approaches to message authentication.
A: What is message authentication? Another method of protection is message authentication. The…
Q: What are the essential ingredients of a public-key directory?
A: In cryptography, a public key is a large number used to encrypt data. Keys can be generated by a…
Q: Consider the following recursive algorithm. Algorithm Mystery A[0..n-1]) //Input: An array A[0..n -…
A: Solution: Given, ALGORITHM Riddle(A[0..n−1])//Input:AnarrayA[0..n −1]of real numbersif n =1…
Q: STUDENTS MARK SHEET Name Maths Science English Physics David 85 Richard 91 John 81 Tony 84 87 81 86…
A: CSS (cascade style sheet) Colors, layout, & typefaces are all described in CSS, a language used…
Q: Programming Exercise 6-4 w Instructions ..... Write a program named CheckZips that is used by a…
A: C# A component-oriented, object-oriented programming language is C#. C# is a natural language for…
Q: why do power query and tableau desktop return different values for their summary statistics?
A: Introduction: There could be a few justifications for why Power Query and Tableau Desktop return…
Q: A company makes items. Each item has a name, ID and component quantity. Every item contains many…
A: Solution: Let's assume- A supplier might exist without providing components. A component may not…
Q: cost of a connection is reduced? Why? How about co
A: The answer is
Q: what is the continuation of: Create these five files [root@localhost ~]# touch godin.py strat.txt…
A: In this question we have to write a cmd command which can search the files with .py and .php Let's…
Q: Consider the following algorithm Algorithm Mystery(A[0..n-1, 0..n-1]) //Input: A matrix A[0..n-1,…
A: As per our company guidelines, only 3 sub parts will be answered. So, please repost the remaining…
Q: Consider a very simple symmetric block encryption algorithm in which 32-bits blocks of plaintext are…
A: Symmetric Encryption: Secret key algorithms are another term for symmetric key algorithms. This…
Q: II. Pushdown Automata. Draw a PDA that recognizes the followi languages. All machines should be…
A: Answer: We have draw the PDA for the given language and also we have explain what i have done in the…
Q: What mask value will make the expression true when applying bitwise inclusive OR (|)? 10011001…
A: It is a multiple-type question. Hence only the first question has been answered. The remaining…
Q: Select all statements that are true when multiplying any 1-digit number by 1. a. The product will be…
A: When multiplying any 1-digit number by 1, the product will be greater than 1. Example: 2*1 = 2 8*1 =…
Q: Do analysis parallel bubble sort and find out its time complexity.
A: Introduction
Q: How is an X.509 certificate revoked?
A:
Q: Comment on data dependency in matrix and Vector multiplication.
A:
Q: Write a piece of code that copies the number inside AL (Only 8 bits) into whole edx, so that the…
A: Here is the solution for the above one:
Q: Given a distance of 50 miles, convert the distance to meters. (HINT: Convert miles to kilometers…
A: Note: As per our guidelines we are supposed to answer only one question. Kindly repost other…
Step by step
Solved in 3 steps with 1 images
- Carry out the following task with an array: a. Allocate an arraya of ten integers. b. Put the number 17 as the initial element of the array. c. Put the number 29 as the last element of the array. d. Fill the remaining elements with –1. e. Add 1 to each element of the array.f. Print all elements of the array, one per line. g. Print all elements of the array in a single line, separated by commas.h. Count how many elements are less than a given value (entered by user). i. Remove all elements that are less than a given value (entered by user). j. Place all elements that are less than a given value (provided by user) in another array.Create an array of N integers. Ask from the user how many elements he/she wants to input in the array. Determine the following: (you may define a function for each item below) sum of all numbers INPUTTED the average of all numbers, count how many are EVEN numbers(excluding zero), how many are odd numbers and how many zeroes were inputted? At the end, print the accumulated and counted values (for items a-e given above) In the array.In statistics the mode of a set of values is the value that occurs most often. Write a program that determines how many pieces of pie most people eat in a year. Set up an integer array that can hold responses from 30 people. For each person, enter the number of pieces they say they eat in a year. Then write a function that finds the mode of these 30 values. This will be the number of pie slices eaten by the most people. The function that finds and returns the mode should accept two arguments, an array of integers, and a value indicating how many elements are in the array.
- Program - python Create an array of 10 integers and pre-populate it with 10 numbers. Then write a function called printit which will loop through the array and print the values out. Call the function to show it works. Now write another function called finditem and pass it the array and a number to find, call the function which should return a boolean if it's found or not. Test it out on the number 50. If the number fifty is in your array it should print True otherwise false.Carry out the following tasks with an array: a. Allocate an array of ten integers. b. Put the number 17 as the initial element of the array. c. Put the number 29 as the last element of the array. d. Fill the remaining elements with –1. e. Add 1 to each element of the array.f. Print all elements of the array, one per line. g. Print all elements of the array in a single line, separated by commas.h. Count how many elements are less than a given value (entered by user). i. Delete all elements that are less than a given value (entered by user). j. Place all elements that are less than a given value (provided by user) in another array.Write a program that will read the monthly salary of 10 employees and then calculates the income tax (i.e, 10% of the salary) and net salary. Hence you have to declare an array salary[10][3]. Your program should have 4 functions. The first function will be used to read monthly salary of 10 employees and put it in the first column of the array. The second function will be used to calculate the income tax for each employee and then store it in the second column of the array. The third function will be used to calculate the net salary of each employee and store it in the third column of the array. Finally, the fourth function will be used to display the gross salary, income tax and net salary for each employee. You must pass the array as reference in each function you used.
- Assignment A scientist has developed a mathematical model for a physical process, and he wants to check how good is model is. To evaluate the correctness of his model, he wants to test the results of his model under certain parameters and compare them with experimental results. Write a program that first reads the number of tests (testCount) as an int followed by the results of each test according to the model as a double array (testModel) and finally the results of each test according to experiments as a double array (testExperiment). Then, the program should calculate the error of the model by evaluating the average of the absolute values (i.e., mutlak değer) of the differences between the model result and experimental result (see formula below) using a function. ItestModel,- textExperiment, testCount NOTE: Individual absolute value of the difference between the model value and the experiment value calculations MUST be done in the function. Every other functionality MUST be done in…Write a program for the following information: Year has 365 days. You create array for temperature of each day in a year. Assign random temp values range of 30-110. Using a function Search in the array do you have 100 degree and what days. Print how many days and what days. Also print the Temp array in nice format in a function. Sample output1.Enter a positive integer value n (6 <= n < 30) and take n integers from the user as input and store them in array a. Then move the elements of this array one step to the left and make the first element of the array the last element of the array. Shift this array with a function. Display integer value n, the array elements in original order and the array elements in modified order (after shifting). For example, if the original order of the array a is like below : a: 33 45 67 89 12 7 After shifting one step to the left, you should get the following order of the array а: a: 45 67 89 12 7 33
- Write a program which takes 2 arrays of 10 integers each, a and b. c is an array with 10 integers. The program should do the following: in c++ 1. Sort the array a using bubble sort. 2. Sort the array b using bubble sort. 3. put into an array c the first five elements from an array a after sorting ,then put into an array c the last five elements from an array b after sorting.5. Write a function which will find the average of all elements of an array of integers. Pass an array and a dimension (the number of elements), and return the value of the average as a float ( the return value). Test this function in the main program with the array: 5, 7, 3, 5, 6, 4.Write a program which takes 2 arrays of 10 integers each, a and b. c is an array with 10 integers. The program should do the following: 1. Sort the array a using bubble sort. 2. Sort the array b using bubble sort. 3. put into an array c the first five elements from an array a after sorting ,then put into an array c the last five elements from an array b after sorting. Example : a={572,6,1,4,8,3,9,10} aaftersorting={1,2,3,4,5,6,7,8,9,10} b = {15, 18, 12, 16, 19, 13, 11, 14, 17, 20} b after sorting = {11, 12, 13, 14, 15, 16, 17, 18, 19, 20} c={1,2,3,4,5,16,17, 18, 19, 20} with c++