Write a method to find top two maximum numbers in a given list. • You should not use any sorting functions. • You should iterate the array only once. • You should not use any kind of collections. • The supplied array will always have more than 2 elements def maxTwo(array): # Your code here return max1, max2
Q: An overview of Visual Studio should be provided.
A: Visual Studio: Visual Studio is a well-known integrated development environment that is used for the…
Q: Why do wireless networks perform worse than cable networks, exactly?
A: Introduction: In general, wireless networks perform poorer than wired networks owing to signal…
Q: What is computer science defined as?
A: The definition of computer science is presented here. Because it is such a broad subject, it…
Q: The definitions of "strict" and "loose" name equivalency are given.
A: Type Equivalence : It is used to determine when the types of two values are the same. There are two…
Q: What is a case where the disjoint rule is applied to a supertype/subtype connection?
A: Disjoint rule: According to the disjoint rule, an instance of the supertype cannot be a member of…
Q: What primary standards are used to evaluate DBMs for data warehousing?
A: Introduction: In mat, a data warehouse (DW) stores and analyses data. Operational frameworks…
Q: Justify why the professional software produced for a customer is more than simply a collection of…
A: Given: It isn't only the programmes that were designed specifically for a consumer since…
Q: Why is it that most languages do not specify the order in which the parameters to an operator or…
A: It is not defined in what sequence any component of an expression, including function arguments,…
Q: The session layer of the OSI model is in charge of dialogue synchronisation and control. Which…
A: Given: The session a layer of the OSI model is in charge of dialogue synchronization and control.…
Q: Should the course registration system for a university website be developed using the Waterfall or…
A: INTRODUCTION: The first Process Model to be introduced was the Waterfall Model. The term…
Q: Why is it OK for a function to sometimes produce side effects?
A: When something has side effects, what does that mean? An operation, function, or expression is said…
Q: Create an IP address plan as efficiently as possible for the network shown below. The address space…
A: Given that,Address space= 192.168.10.0/25Network A = 50pcsNetwork B = 20pcs
Q: What limitations may there be on the su command?
A: Given: We have to discuss what limitations may there be on the su command.
Q: In a classroom of 27 students, 11 students have a blue pen, 12 students have a red pen, 7 students…
A: We are given information about a classroom of 27 students. We are asked how many students carry only…
Q: Nancy is leading a Scrum project for her organization. The project is to create new software for the…
A: The scrum team discusses the project requirements and helps Nancy and Tom identify the team's…
Q: 0 = {0} True or False explain why
A: A binary number is a number represented in a base-2 number system or binary number system, usually a…
Q: How is a double-valued vector created? How can a vector have a double attached to it? What is the…
A: Enter duplicate in vector: Then, using Push back (element: elementType): Void to add an item to a…
Q: What students will learn: . The purpose of repetition structures • Three kinds of loops that are…
A: output Screenshot:
Q: What are the main features of graphics and media programmes such desktop publishing, computer-aided…
A: Your answer is given below.
Q: What are a few uses for SSH that you could have in mind? Can you define the SSH protocols and…
A: SSH, often called Secure Shell or Secure Socket Shell, is a network protocol that provides users,…
Q: What information is included in each item of the interrupt vector table?
A: Information is a stimulus that has meaning to the recipient in a specific context.
Q: How does a file management system operate and what is it?
A: File management system: The process of managing a system that maintains digital information is…
Q: Give examples of how all types of software systems may benefit from the key software engineering…
A: Basic computer fundamentals Software is a collection of programming instructions that, when…
Q: Create a new class in the practicum1 package named ArrayUtilities. Write a method in the class that…
A: Output Screenshot:
Q: What distinguishes traditional deterministic programming from probabilistic dynamic programming?
A: Introduction In this question, we are asked to distinguish traditional deterministic programming…
Q: How can inline style sheets override the formatting of an HTML document?
A: Answer: You should put inline styles in the <body> of the HTML document, while implanted style…
Q: What is growth function? What connection exists between fundamental algorithmic analysis and the…
A: Given: Can you explain the concept of functional growth? How the development of functions and the…
Q: benefits come from creating and running an IA
A: What benefits come from creating and running an IAP?
Q: Why is it OK for a function to sometimes produce side effects?
A: Given: What exactly is meant by the term "function" when it comes to side effects In the field of…
Q: What security software do you have on your computer(s)? How successfully did it keep your system…
A: Even if you're using a Mac or Windows device with built-in virus protection, antivirus software is…
Q: 4.31 LAB: Months until payoff (JAVA) Write a program in java that reads a loan amount, payment…
A: ANSWER:-
Q: Describe three potential case statement implementation search algorithms and the circumstances in…
A: An algorithm is a procedure used to solve a problem or perform a calculation.
Q: Give Seven characteristics of a candidate key
A: QUESTION Answer: Candidate key is a single key or a group of multiple keys that uniquely…
Q: What are scriptlets, and how do they operate?a
A: Ans: A scriptlet is a type of software code that is employed by the native scripting language of a…
Q: There are three subtleties in the design of enumeration-controlled loops that are presented.
A: Enumerated controlled loops Enumeration-controlled loops repeat a collection of statements a…
Q: How can a new type named doublePointeutir be produced that can be used in place of double*?
A: According to what is stated in the definition: Of the typedef keyword, the declaration of typedef…
Q: A small research company in Pittsburgh is working to develop a new method of mass storage to replace…
A: THe answer is
Q: The words prefix, infix, and postfix notation should be defined. What does the term "Cambridge…
A: Initial notation: Here, we move the operator's operands to the left. Ex: In this case, (A+B) is…
Q: Why is it that most languages do not specify the order in which the parameters to an operator or…
A: Introduction: If you are able to make substitutions and determine the value of a straightforward…
Q: In a classroom of 27 students, 11 students have a blue pen, 12 students have a red pen, 7 students…
A: We are given information about a classroom of 27 students. We are asked how many students carry only…
Q: Description of Each request has its own object. b. Directions versus c. Model-View-Controller
A: objects for requests and responses The Hyper Text Transfer Protocol underlies the whole internet…
Q: The words prefix, infix, and postfix notation should be defined. What does the term "Cambridge…
A: Initial notation: Here, we move the operator's operands to the left. Ex: In this case, (A+B) is…
Q: Write a function, which given an int n, prints out a slash-based ASCII art of size n. Below is an…
A: The Python code is given below with code and output screenshot Happy to help you ?
Q: What type of possible error messages y
A: The answer is
Q: Why is it that most languages do not specify the order in which the parameters to an operator or…
A: Parameters of the Function: The names of the arguments that are passed into a function are referred…
Q: What do you mean by Data Terminal Equipment(DTE) ? (
A: Data Terminal Equipment (DTE) is equipment that is either a destination or source for digital data.
Q: Windows file explore or apple finder are types of
A: Windows file explore:- To open The File Explorer icon located in the taskbar. you can open the File…
Q: Open-source software is produced by the Network Funtime Company. The business features a small sales…
A: My primary responsibility as the system administrator for the Network Funtime firm is to protect it…
Q: Define orthogonality in the context of the design of computer languages.
A:
Q: The definitions of "strict" and "loose" name equivalency are given.
A: strict name equivalence a language in which aliased types are considered distinct (hence raises a…
python please thank you
Step by step
Solved in 3 steps with 2 images
- Modify the quick sort implementation in the textbook to sort the array using pivot as the median of the first, last, and middle elements of the array. Add the modified quick sort implementation to the arrayListType class provided (arrayListType.h). Ask the user to enter a list of positive integers ending with -999, sort the integers, and display the pivots for each iteration and the sorted array. Main Function #include <iostream>#include "arrayListType.h"using namespace std; int main(){ arrayListType<int> list;int num;cout << "Line 8: Enter numbers ending with -999" << endl;cin >> num; while (num != -999){list.insert(num);cin >> num;} cout << "Line 15: The list before sorting:" << endl;list.print();cout << endl; list.selectionSort();cout << "Line 19: The list after sorting:" << endl;list.print();cout << endl; return 0;} Header File (arrayList.h) Including images #include <iostream>#include <cassert>…Project Description: In this project you implement an ArrayStack ADT and use the stack for implementing the following methods: a) Reverse an array of Words: Accept an array of words as input parameter and return an array of words in reverse order. Use the method signature: public static String[] reverse Words (String[] wordList) Example Input: Bird Cat Dog Elephant Output: Elephant Dog Cat BirdExercise 1: Write a program that generates a sequence of 20 random values between 0 and 99 in an array, prints the sequence, sorts it, and prints the sorted sequence. Use the sort method from the standard Java library. Exercise 2: Write a program that stores a list of countries: "Egypt", "Switzerland", "Argentina", "Spain", "Portugal", "Luxemburg", etc. Initialize your array with a single statement. Then print out the array. Use the sort function as before to sort the countries in alphabetical order. Reprint your array. Exercise 3: Implement exercises 1 and 2 using ArrayList. Use the Collections.sort method for sorting. After you have printed and sorted your results, then append an additional element to each list and reprint your ArrayLists. Notice that the new items will appear just at the end and will not be sorted. Resort and print out the new ArrayLists again. To clarify, you should print out your ArrayLists after your first sort, after adding items with the…
- Complete the findMax() method that returns the largest value in array nums. Ex: If array nums contains: 2 4 6 8 10 7 5 3 the findMax() method returns: 10 Note: During development, array nums is filled with 10 pseudo-random integers in main() using the fillRandomly() method with a seed value of 7. When submitted, different seed values will be used to generate arrays of different size for the test cases. Refer to the textbook section on Random numbers to learn more about pseudo-random numbers. Code: import java.util.*;public class Numbers { private int[] nums; public int findMax() { /* Type your code here. */ } public void setNums(int[] nums) { this.nums = nums; } public int[] getNums() { return nums; } // Fill array nums with pseudo-random integers (0-999) with a seed value public void fillRandomly(int seed, int size) { Random rand = new Random(seed); nums = new int[size]; for(int i=0; i<nums.length; i++) { nums[i]…1. You have an array of four integers that has been sorted from lowest to greatest value in the array. You also have a function that does a bubble sort in order to arrange things from lowest to greatest priority. If you call this method on your array, the function will perform at least one swap on your array. If false, why is it untrue?Create an array of size 7 of integers1, -9, 10, 20, 5, 6, 7 . You can set these numbers in the code with initialization. (10 points)•Write a function that accepts anarray and returns the location/index of any value passed to the function. Test it with value 20 and value -1 (20 points) *HELP: this is linear search•Test it with value 7and write code in your “main” to see if it is the last element in the array
- Write code that loops through the array myVals. Each iteration: If myVals[i] is less than smallestNum, assign smallestNum with myVals[i]. Remember to assign smallestNum with some value before the loop.Create 2D array 4 *5. Ask the user to enter the number inside the array. Print the numbers organized by rows. Calculate the average for each row. Print the least average. Finally, create a method that receives a 2D array to print its elements reverse starting from the last element.Create an array of size 7 of integers1, -9, 10, 20, 5, 6, 7 . You can set these numbers in the code with initialization. •Write a function that accepts anarray and returns the location/index of any value passed to the function. Test it with value 20 and value -1 *HELP: this is linear search•Test it with value 7 and write code in your “main” to see if it is the last element in the array
- Write the following method that sorts an ArrayList of numbers:public static void sort(ArrayList<Integer> list)Write a test program that prompts the user to enter five numbers, stores them inan array list, and displays them in increasing order.Suppose you are given a list of students registered in a course and you are required to implement an array-based student list. Each student in the list has name, regNo, department and cGpa. Implement different functions for entering the data (like constructor (for setting to default values), setName, setReg, etc.). You also need to implement the following function related to the array. insertStudent( ) : It has 2 options • Asking the user for index and then insert the student at that index AND • Asking the user for name of the student where the new student is to be added (New student should be added at the index of the student whose name is entered) o If the list is full, it should create a larger list (new size should be entered by the user), copy all the data in it and make insertion as instructed o (Insertion will only be made if the reg of the new student doesn’t exist in the list) deleteStudent( ): Same as insertStudent( ) (either by asking the index or student name) sort( ): Ask…If N represents the number of elements in the collection, then the contains method of the ArrayCollection class is O(1). True or False If N represents the number of elements in the list, then the index-based add method of the ABList class is O(N). True or False