The following BST dataInReverse Order function has an error. Complete the testDataInReverseOrder test function using the provided assert True function to discover dataInReverseOrder's error (i.e., fail). The test should pass once the function is fixed. Note: this code is meant to be compiled by itself, so do not assume the existence of an insert function, etc. #include #include #include using namespace std; void assertTrue (bool b, string s) { if (b) { cout << "PASSED: " << s << endl; } else { cout << "FAILED: " << s << endl; } } struct BSTNode { int data; BSTNode left; BSTNode" right; }; // returns a vector of all the data in a BST in reverse sorted order (i.e., descending order) vector dataInReverseOrder (BSTNode* root) { // empty tree case if (root == nullptr) return {}; // non-empty tree vector right = data InReverseOrder (root->right);
Q: Implement Priority scheduling algorithm with preemption in C programming. NOTE: Please do not print…
A: Algorithm: Priority Scheduling with PreemptionInput: Number of processes (n), burst times, arrival…
Q: Problem 0. Write a version of hello.c that creates and reaps (joins) n threads, each of which prints…
A: The following steps need to be taken for the given program:We define a function which delegated to…
Q: in kotlin, Use this Employee class data class Employee(val name: String, val wage: Double, val…
A: In this program, the raise function takes a list of Employee objects and a Double representing the…
Q: 1. According to a recently published IMF report (2017), crime seems to be on the increase across…
A: NOTE: This is a multiple questions based problem. As per company guidelines only first question is…
Q: Using the following Huffman Tree, what is the compressed bit-string encoding of the string "FINAL"?…
A: Huffman coding is a data compression algorithm that uses frequency of occurrence to give…
Q: How does the z buffer algorithm solve problems in computer graphics?
A: The objective of the question is to understand how the z-buffer algorithm helps in solving problems…
Q: I need help with my MATLAB code. I am trying to numerically integrate two sets of equations. I want…
A: Start.Define constants and initial conditions.Calculate the Euler parameters (EP) using a given…
Q: с Which of the above logic gates (enter a, b or c) is an Inverter gate? A/ Which of the above logic…
A: Inside the context of electronics and virtual circuits, a "gate" can be defined in such a way that…
Q: a) Identify the two memory management defects in the code. Point out the line numbers where the…
A: In this question we have to understand about given code snippet in C++ and answer for the following…
Q: In the Barney-Jones investment model, we ran invest- ments across columns and years down rows. Many…
A: An investment model is a structure or series of principles used by investors to make decisions on…
Q: Begin by locating several peer-reviewed articles from the past 5 years that support the problem you…
A: The question of its effectiveness in improving school outcomes has been raised over the last few…
Q: What is ray tracing in rasterization?
A: The objective of the question is to understand the concept of ray tracing in the context of…
Q: two .php files 1- DisplayStudentGrades.php 2- addnewStudentwithgrades.php
A: The task involves creating a MySQL database named StudentsDB with two tables: Students and Grades.…
Q: please answer all questions You need to generate a (5x12) rain matrix (Rain[5][12]) that contains…
A: RainGen function :Initialise a randome number generator with seed 67Generate random rainfall…
Q: In Kotlin, use this Employee class Use this Employee class data class Employee(val name: String, val…
A: Algorithm:Define a data class Employee to represent employee details with properties: name, wage,…
Q: 1. Apply Dijkstra's SSAD algorithm to find the shortest distance from vertex 0 to every other vertex…
A: Dijkstra's algorithm is used to solve the single source shortest path problems. It works on directed…
Q: Using the Use Case Diagram and Class Diagram modeling a food delivery system, create a context…
A: Context diagram is an UML diagram which shows the interactions between the system and other actors…
Q: i need this code to work by Calculate all the single-digit Fibonacci numbers in order Start with…
A: The provided LC-3 assembly code is designed to calculate and print the first six numbers in the…
Q: Please solve and show all work and steps. Translate the following C code to MIPS assembly…
A: The provided C code provides the basic function leaf_example, which returns the value of the…
Q: Can someone look at my code and tell me why my sequential access was slower than my random access. I…
A: The idea that sequential access should be faster than random access is generally correct. However,…
Q: Problem 5: Let T be a binary search tree with n elements. Write an O(n)-time algorithm that builds a…
A: A deterministic skip list is a data structure that augments the traditional skip list with a…
Q: A 1000-lb weight is supported by 3 cables as shown in the figure. Note that cable #3 is attached…
A: In this question we have to write a python code for the given image description.Let's code and hope…
Q: On Cisco Packet Tracer, please design the following networks: An office with three printers and one…
A: An introduction to Cisco Packet Tracer and network design would cover the basics of what Cisco…
Q: In the model in Example 15.5, suppose bonuses and penalties are incurred for earliness or lateness.…
A: Algorithm:Define the LAN project activities, network structure, and simulation parameters.Simulate…
Q: What is the primary key for the table "movies"? Options: title • movie_key film id • movie_id
A: Tables in databases require a primary key to uniquely identify each record. The primary key serves…
Q: Explain in a clear and concise manner, why a compressed file is bad for Steganography.
A: The objective of the question is to understand why compressed files are not ideal for steganography.…
Q: A Prof believes that all the effort spent on access control matrices and access control lists is a…
A: The objective of the question is to identify five unique scenarios where users other than a file’s…
Q: The Horse table has the following columns: ID - integer, auto increment, primary key RegisteredName…
A: The objective of the question is to update certain records in a database table named 'Horse'. The…
Q: Write an ALP to find factorial of a number 04h and store the result in the memory address 5000h
A: To find the factorial of the given number involves repeatedly multiplying all the numbers from 1 to…
Q: You are given the class definition for CashRegister, and you are writing client code to set up an…
A: In step 2, I have provided answer with brief explanation...
Q: What is the value of x after the following statement(s)? m = { 1:10 'apple'; [] [78] }; x = numel(…
A: To find the value of x using matlab.
Q: Given N cities represented as vertices V₁, V2,...,UN on an undirected graph (i.e., each edge can be…
A: In a uniform-cost search, vertices are explored based on the cost of reaching them from the source…
Q: using the code write a query to display the movie number, movie title, and price code for all movies…
A: Algorithm:Define a table named PRICE with columns PRICE_CODE, PRICE_DESCRIPTION, PRICE_RENTFEE, and…
Q: Summary Jason, Samantha, Ravi, Sheila, and Ankit are preparing for an upcoming marathon. Each day of…
A: 1. Include necessary libraries: iostream, fstream, string, iomanip2. Declare functions: - getData:…
Q: Study the following class definition: class Car { public: Car(double speed); }; void start(); void…
A: This class has a private member variable speed, along with public member functions like start,…
Q: using java netbean create a menu using multiple panels and shows a receiept next to the menu menu:…
A: The objective of the question is to create a graphical user interface (GUI) in Java using NetBeans.…
Q: create a Word document that contains the pseudocode, flowchart, and test plan for (Programming…
A: pseudocode1function locateLargest(a: double[][]): 2 location = [0, 0] 3 largest = a[0][0] 4 5…
Q: Please solve the following problem in C++ and do not use vectors or while(true) make sure there is a…
A: In this question we have to write a code in C++ to find the average nights per reservation and…
Q: Part 1a: Generate a random 4 by 4 matrix using https://onlinemathtools.com/generate-random-matrix.…
A: As per our guidelines, we are supposed to answer only 1st three parts. Kindly repost the remaining…
Q: Which of the following leads to a model being selected with the fewest number of variables? Lasso…
A: In statistical modeling, choosing an ideal arrangement of factors is urgent to build a tight-fisted…
Q: Example of example by holding out(JUST EXAMPLE. DO NOT COPY FROM INTERNET!!!!)
A: "example by holding out" in the context of machine learning is a technique that uses withholding…
Q: Write a Python program named "YourInventory Searching.py" that starts by defining and initializing…
A: Linear Search: For each item in the list: Compare the item with the target. If they match,…
Q: Suppose the variable my_register is declared to be of type Cash Register, which is an object.…
A: In software development, a member function is a dedicated function associated with a particular…
Q: what is the purpose of express.js middleware?
A: Express.js middleware plays an important role in request-response cycle of an Express application.…
Q: In a movie theater application, there are Movie Theater, Movie, and Artist classes. Movie Theater…
A: In C++, aggregation signifies a unidirectional relationship between objects of two classes,…
Q: Design a 4-bit Asynchronous Counter up/down (Note: Please have the design be a clear outline or…
A: Here's the design of a 4-bit asynchronous counter up/down:Counter DesignThe 4-bit asynchronous…
Q: Question 3. The following MIPS code might produce data hazard when executed. Study the code and…
A: When an instruction's proper execution depends on the availability or timing of data generated by a…
Q: Q8: Substitute Write a procedure substitute that takes three arguments: a list s, an old word, and a…
A: Creating a "substitute" procedure that works with a list, an old term, and a new word is the…
Q: Two tables are created: Horse with columns: ID - integer, primary key RegisteredName -…
A: The objective of the question is to create a table named 'LessonSchedule' in SQL with specific…
Step by step
Solved in 3 steps with 1 images
- Find the C program language Breaking the Code by CodeChum Admin ATTENTION SOLDIER! This will be the hardest mission of your life. Our intelligence department has caught the enemy sending codes from one base to another. These enemy codes can either be a simple communication message or a mastermind plan. Our intelligence department has determined that a mastermind plan is a code that has at least 1 consonant character. Since you know programming, your task is to check a code if it is a mastermind plan or not.Create a dynamic array that contains an int array. dynamic array, array inside when the existing array is full and a new element needs to be added will double its size, make all the elements of the old array the same will copy the indexes and add the element to the new array. Use the following functions. Write in C language. 1.append(dynamic array, new element): function sent to itself Adds the element sturct to the end of the array inside DynamicArray. Place If not, it behaves in accordance with the dynamic array definition given above. 2. get(index): The element in the index sent to it by the function takes it from the array it hosts and sends it back. ATTENTION ! : Please use a dynamic array and this array with struct structure. I don't want a link list. Do not post wrong or copied codes. Be sure to use the append and get functions given above Please do not solve the question I asked with the same code and copy and paste the code, my right to the question is running out. Solve the…Create a dynamic array that contains an int array. dynamic array, array inside when the existing array is full and a new element needs to be added will double its size, make all the elements of the old array the same will copy the indexes and add the element to the new array. Use the following functions. Write in C language. 1.append(dynamic array, new element): function sent to itself Adds the element sturct to the end of the array inside DynamicArray. Place If not, it behaves in accordance with the dynamic array definition given above. 2. get(index): The element in the index sent to it by the function takes it from the array it hosts and sends it back.
- Create a dynamic array that contains an int array. dynamic array, array inside when the existing array is full and a new element needs to be added will double its size, make all the elements of the old array the same will copy the indexes and add the element to the new array. Use the following functions. Write in C language. 1.append(dynamic array, new element): function sent to itself Adds the element sturct to the end of the array inside DynamicArray. Place If not, it behaves in accordance with the dynamic array definition given above. 2. get(index): The element in the index sent to it by the function takes it from the array it hosts and sends it back. Do not use link lists. Solve the question using array.Write two functions using the following headers:int generate01()void printMatrix(int n)The first function generates and returns a random number either 0 or 1.The second function prints an n-by-n matrix. Each element of the matrix is using the number generated by thefirst function.Write a test program that prompts the user to enter n and uses printMatrix to display an n-by-n matrix. Hereis a sample run:Enter n: 30 1 00 0 10 0 0- ### Question 18 Write a R code to do this calculation with a logistic regression model. Compute a CI of this OR. You will use the arrays xp and yp built above. First use the glm function to fit a logistic regression model using of yp versus xp. Save the model to an object named mp: Paste your R code in BOX 1 [Format:a30] `{r} Use the exp, cbind and coef function to calculate the odds ratios (intercept and xp) and their 95% confidence intervals, as done in the preparation lab. Paste your R code in BOX 2 [Format:a35] {r}
- Task 1:Modify the function header so it looks like this:int countElement(int inputArray[], int arraySize, int element1, intelement2)The function should now be modified to return either 0, 1 or 2, according to the following:● Return 0 if neitherelement1 nor element2 occur in inputArray.● Return 1 if exactly one of element1 or element2 occurs at least once ininputArray.● Return 2 if bothelement1 and element2 occur at least once in inputArray.Write the function definition for a value returning function that receives an array of integer values, the array length, and an integer target value as parameters. The function should perform a li ear (sequencial) search for the target value. If the value is found, the function should return the index position of the target value, otherwise, it should return -1. Write only the function definition.3) Create a function named "makeThemOdd". The function should accept a parameter named "numberArray". Use the higher order function map() to create a new array that contains all the numbers from the original parameter array but adds 1 to each even number. The new array should only have odd numbers in it. Return the new array. // Use this array to test your function:const testingArray = [1, 2, 4, 17, 19, 20, 21];
- Programming language: C++ Implement a function named insert that takes a dynamically allocated array of ints, the array’s length, the index at which a new value should be inserted, and the new value that should be inserted. The function should allocate a new array populated with the contents of the original array plus the new value inserted at the given index. The originally array should be freed. The following sections provide a detailed description of this function: Make sure your source code is well-commented, consistently formatted, uses no magic numbers/values, follows programming best-practices, and is ANSI-compliant. It is expected to have the program outputArray Processing. In this problem, you have two tasks: To create the header file, arrayOptn.h, and add the function declarations of the following functions listed below. To create the file, arrayOptn.c, which implements the functions in the arrayOptn.h You are already provided with the main() function. Do not edit anything there in the main.c file. List of functions to be implemented: 1 - void createArray(int arr[], int count, int maxCapacity) Parameters: int arr[] - a reference to an array int count - the number of elements to be inputted by the user and to be stored in the array int maxCapacity - the max capacity of the array Description: Asks the user for the elements of the array. The prompt message is: "Enter element at index N: " where N is the current index position being scanned. Each inputted integer must be unique. If an element already exists in the array, you prompt the user the message "Inputted element already exists, try another number" If the count is…use C++ programming language Write a modular program that analyzes a year’s worth of rainfall data. In addition to main, the program should have a getData function that accepts the total rainfall for each of 12 months from the user and stores it in an array holding double numbers. It should also have four value-returning functions that compute and return to main the totalRainfall, averageRainfall, driestMonth, and wettestMonth. These last two functions return the number of the month with the lowest and highest rainfall amounts, not the amount of rain that fell those months. Notice that this month number can be used to obtain the amount of rain that fell those months. This information should be used either by main or by a displayReport function called by main to print a summary rainfall report similar to the following: 2019 Rain Report for Springdale County Total rainfall: 23.19 inches Average monthly rainfall: 1.93 inches The least rain fell in January with 0.24 inches. The most rain…