.ctions pr OV isioned on the W hen your ne following actions to be performed on the BST. 1. Insert an element into the BST 2. Sear ch for an element in the BST 3. Find the maximum element from the BST 4. Find the minimum element from the BST 5. Print the elements in the BST in preorder 6. Print the elements in the BST in postorder 7. Print the elements in the BST in inorder 8. Delete an element Anything else to exit the progr am
Q: Q.No.2: a) Design an adjacency Matrix of the alphabets of your full name. In accordance with the…
A: Name : - MUHAMMAD BILAL Alphabets M U H A D _ B I L M 0 0 0 0 0 1 0 0 0 U 0 0 0 0 0 1 0 0 0…
Q: Create the following matrix by typing one command. Do not type individual elements explicitly. * G =…
A: M = [ones(3, 6); zeros(3),ones(3)] This is the command
Q: Write a code that can create a [n×m] dimensional matrix. Take the values of all the elements from…
A: "Since you have not mention any programming language, so we will write our program in C language."…
Q: a) What size is A? b) What is the third column of A? e) What is the second row of A? d) What is the…
A: a) What size is A? Ans- 3 (size of array is the number of rows of 2d array) b) What is the third…
Q: Let x and y be two numpy arrays with x.shape = (6, 4, 3, 2) and y.shape = (3, 2). What is the shape…
A: (3,2)
Q: 3. Starting at the end of strArr and working back toward the beginning, display each index and the…
A: strArr is a function that returns a string array containing zero-length strings. Iteration using a…
Q: After executing the following codes in Jupyter notebook, the value of y is , the value of num is and…
A: Here we have variable num with value 4 and a list last with values 2,3, and 4. Now we have a method…
Q: Given an string representing a 2D array of integers that contains the locations of the two…
A: #include<bits/stdc++.h> using namespace std; // function to store all the indices of a single…
Q: DCreate five row vectors, the first A with 6 random integer numbers between 10 and 30, the second B…
A: Find the required code given as below and output : As per the company guidelines we are supposed to…
Q: 3. This question uses the list myList created in the previous question. (a) Calculate the vector…
A: Below find the solution !!
Q: 03/ Create five row vectors, the first A with 6 random integer numbers between 10 and 30, the second…
A: Find the required code in matlab given as below and output : As per company guidelines we are…
Q: n the range (10,40]. Then, 2) find the average of the even elements that are less nsert a column of…
A:
Q: Write a PHP script in html that creates a variable $states with the value "Mississippi Alabama Texas…
A: PHP CODE: <?php //Initializing string $states = "Mississippi Alabama Texas Massachusetts…
Q: Q4/Write a computer programming that create unknown size and content matrix then put (3) in the main…
A: #include <stdio.h>#include <stdlib.h> int main(){ unsigned seed = time(0);…
Q: That's enough for you! def first_preceded_by_smaller(items, k=1): Find and return the 0irst element…
A: Coded using Python 3.
Q: Q. No.2:| a) Design an adjacency Matrix of the alphabets of your full name. In accordance with the…
A: Let the name is SOPHIA Adjacency Matrix will be Alphabets S O P H I A S 0 0 0 0 0 0 O 0 0 0 0…
Q: 3- Place the given pages in using LRU alporithm. Count the number of parefaults. (LRIJ (LRJ : Least…
A: In LRU algorithm, the page which is least recently used is replaced with new page Page Fault is a…
Q: As seen in the image below, the resulting matrix elements should be the sum of the respective pair…
A: The JAVA code is given below with code and output screenshots
Q: Given the matn'x as shouwn below and assume each elemen stores an integer numher. メ X X x X X a.…
A: The matrix given here is an 2-D array of size 4x5 containing 20 elements. Nested loops will be used…
Q: The missing element in the following sequence 0,2,8,26,80, 728 is
A: The pattern is an = 3n-1 - 1
Q: Add each element in origList with the corresponding value in offsetAmount. Print each sum followed…
A: We have to find the sum of each elements of the arrays : origList and offsetAmount. As required, the…
Q: 1. Create the matrix A such as 1 2 3 4 5 6 7 8 9 A = a Display the element in the second raw, first…
A: Note: Answering the first three subparts as per the guidelines Input : Matrix of integer values…
Q: Create a copy of S, say P. Subtract -5 from all the middle column elements of P. Insert a new row of…
A: According to the information given:- We have to follow the instruction mention to satisfy the copy…
Q: If A has 4 elements B has 12 elements then the minimum and maximum number of elements in A UB are…
A: a)12,16
Q: 1 v = [1 60-8 59 9 71; 2 count = 0; 3 gfor n=1:length(v) a = v(n); 5E while a > 0 4 --a; 7 ++count;…
A: It is defined as the vector that returns number of occurrences of an element in a given range.…
Q: The Iris Dataset import sklearn.datasets import matplotlib.pyplot as plt import numpy as np import…
A: Q: Write a function that takes in an index i and prints out a verbose desciption of the species and…
Q: Q1 (A) Create the following matrix K K = K = 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2 4 6 8 10 12 14 25 30…
A: Ans:) NOTE: I am doing this program using MATLAB. All the matrix, K, Ga, and Gb are created and…
Q: 1 v = [1 60-8 599 71; 2 count 3 Bfor n=l:length (v) a = v(n); 5E while a > 0 0; %3D 4 --a; ++count;…
A: Use zeros function instead of a loop to assign 'a' as zero vector.
Q: map() Without using the native “Array.prototype.map” method of JavaScript, compose a function…
A: Here, I have to provide solution for the above question.
Q: Make a comparison between a linked list and a linear array. Which one will you prefer to use and…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost other questions as…
Q: Assume having an array of integer numbers named list. | a. listf0] = list[list length-1]; ‘The code…
A: Lets see the solution.
Q: def clean_span_data(raw_spans: str) -> List[float]: """Return a list of span lengths from raw_spans,…
A: def clean_span_data(raw_spans: str) -> List[float]: """Return a list of span lengths from…
Q: def t2(X): ILII || Inputs: - X: A numpy array of shape (N, N) Returns: Numpy array of shape (N,)…
A: import numpy as np def t2(X): return np.linalg.eig(X)
Q: Consider the following BWT: smnpbnnaaaaa$a Generate the LastToFirst (L2F) array from this BWT. What…
A: #include <iostream>#include <string.h> using namespace std; int main(){ char…
Q: Q3/ Create five row vectors, the first A with 6 random integer numbers between 10 and 30, the second…
A: //note: since programming language is not specified, we are providing answer in cpp #include…
Q: Q 5/ Build column vector elements from randomly a column vector with 4 element values between 0 and…
A: x = 1 2 5 7 1- transpose: y=transpose(x) Output: 1 2 5 7
Q: Consider the below 2D array and identify the Column Major order representation. P Q Z I J K O a.…
A:
Q: Q1 a. Design an adjacency Matrix of the alphabets of your full name “Ghazi Messam”. In accordance…
A: Adjacency Matrix Alphabets G h a z i _ M e s G 0 0 0 0 0 1 0…
Q: Write the C sharp as well as C++ code: merge without extra space
A: In this question, we need to merge two arrays with extra space. So the C sharp, as well as C++ code,…
Q: Q 5/ Build column vector elements from randomly a column vector with 4 element values between 0 and…
A: Matlab Code: clcclear%first column vector with 4 elementsa=randi([0,10],4,1);%second vector of (1*2)…
Q: Design an adjacency Matrix of the alphabets of your full name. In accordance with the following…
A: Answer: Given name: Rana awais Step 1: If your name has repeated characters (e.g. character E, 2…
Q: ?What is the output of the following code A = [1,1,2;3,6,9] b = [3, 4] C = A.* b اخترأحد الخيارات a.…
A: Given A=[1,1,2;3,6,9] b=[3,4] Number of rows in A=2 Number of columns in A=3 Number of rows in B=1…
Q: dai prog as the performs the following tasks: • prints the matrix row-by-row using a nested looping…
A: I have written the code below:
Q: The zeros(m,n) command creates a matrix with m rows and n columns, in which all the elements are…
A: In this question we have to answer some of the MATLAB Program for the valid or invalid points. Let's…
Q: Using OQL, you may do which of the following? a. Return an entire collection of elements including…
A: OQL stands for object query language. OQL is use to create new databases or insert data into…
Q: In sas I did 2 arrays and created a new data set call it set A and set B. Now when merging It merges…
A: A fuzzy merge occurs when there is no clear key for matching observations between two or more data…
Q: Q.No.2: a. Design an adjacency Matrix of the alphabets of your full name. In accordance with the…
A: Suppose the name is Jan Smith 1. There is no repeated characters. 2. There is only S in the name…
Q: Create the following matrix by typing one command. Do not type individual elements explicitly. * A =…
A: By using MATLAB we can generate a matrix by using square brackets[] in one command itself. 1. the…
Q: Print a matrix of cells whose size is (3 x 2) and its elements are as follows: The first line is two…
A: struct s { vector<vector<int>> vect; string name; int number; };…
Step by step
Solved in 2 steps
- Computer Science using java The program has to evaluate arithmetic expressions using a BST for thatpurpose. The rules are the following:The program asks the user to enter an arithmetic expression in the infixformat. Then the program builds a BST for that expression. After buildingthe BST, a menu will be present to the user allowing him to: traverse the BST in inorder, traverse the BST in postorder, traverse the BST in preorder.Users will choose among the options present. The result will be thedisplay of the original arithmetic expression and the new one thatdepends on the option chosen. The program should repeat as long as theuser wants.C++ A robot is initially located at position (0; 0) in a grid [?5; 5] [?5; 5]. The robot can move randomly in any of the directions: up, down, left, right. The robot can only move one step at a time. For each move, print the direction of the move and the current position of the robot. If the robot makes a circle, which means it moves back to the original place, print "Back to the origin!" to the console and stop the program. If it reaches the boundary of the grid, print \Hit the boundary!" to the console and stop the program. A successful run of your code may look like:Down (0,-1)Down (0,-2)Up (0,-1)Left (-1,-1)Left (-2,-1)Up (-2,0)Left (-3,0)Left (-4,0)Left (-5,0)Hit the boundary! or Left (-1,0)Down (-1,-1)Right (0,-1)Up (0,0)Back to the origin! About: This program is to give you practice using the control ow, the random number generator, and output formatting. You may use <iomanip> to format your output. You may NOT use #include "stdafx.h".JAVA CODE PLEASE Functions With No Parameters and Return Values Quiz by CodeChum Admin Create a function named banner that prints “CodyChum” with a newline. In the main function, write a program that accepts an integer input which would serve as an inclusive stopping point of a loop iteration that starts at the value of 1. If the number that loops through the range is divisible by either 2 or 3, then call the banner function, otherwise just print the number. Input 1. One line containing an integer Output First line is the integer user input. Succeeding multiple lines containing an integer or “CodyChum” 10 1 CodyChum CodyChum CodyChum 5 CodyChum 7 CodyChum CodyChum CodyChum
- Java only Design, implement and test a Java class that processes a series of triangles. For this assignment, triangle data will be read from an input file and the program’s output will be written to another file. The output file will also include a summary of the data processed. You must use at least one dialog box in this program. The data for each triangle will be on a separate line of the input file, with the input data echoed and the results referred to by the line number (see example). On initialization, the program will prompt the user for both an input and an output file. If a non-existent input file is specified, the appropriate exception must be handled, resulting in an error message. For the exception case, re-prompt the user for the correct input file. Once the I/O file is specified, the program will read in and process all the entries in the file. The output of the program will be written to the specified output file and echoed to the console. The program will…In this programming exercise you will implement two functions. The first function will prompt the user for a file containing the number of vertices and entries of the adjacency matrix of a graph. It will return a two-dimensional list (a list of lists) containing the adjacency matrix. The textfile is named inputfilename.txt am trying to read for the matrix 80 1 2 3 100 100 100 1001 0 2 100 3 4 100 1002 2 0 4 4 100 5 1003 100 4 0 100 100 4 100100 3 4 100 0 3 3 3100 4 100 100 3 0 100 1100 100 5 4 3 100 0 2100 100 100 100 3 1 2 0 def readMatrix(inputfilename): ''' Returns a two-dimentional array created from the data in the given file. Pre: 'inputfilename' is the name of a text file whose first row contains the number of vertices in a graph and whose subsequent rows contain the rows of the adjacency matrix of the graph. ''' # Open the file f = open(inputfilename, 'r') # Read the number of vertices from the first line of the file n =…For this problem set, you will submit java file named Homework.java Return Growing NumList This function will be given a single number, it should return a list of strings of numbers. Each string in the list will only contain a single number repeated an arbitrary amount of times. The number each string will contain will be equal to the current string's index+1. The number in the string should be repeated the same number of times as the string's index+1. Each number in the string should be separated by a space. This list should stop when its size equals the max number specified. Signature: public static ArrayList<String> returnGrowingNumList(int max) Example: INPUT: 3OUTPUT: [1, 2 2, 3 3 3] INPUT: 6OUTPUT: [1, 2 2, 3 3 3, 4 4 4 4, 5 5 5 5 5, 6 6 6 6 6 6]
- The implementation of a queue in an array, as given in this chapter, uses the variable count to determine whether the queue is empty or full. You can also use the variable count to return the number of elements in the queue. On the other hand, class linkedQueueType does not use such a variable to keep track of the number of elements in the queue. Redefine the class linkedQueueType by adding the variable count to keep track of the number of elements in the queue. Modify the definitions of the functions addQueue and deleteQueue as necessary. Add the function queueCount to return the number of elements in the queue. Also, write a program to test various operations of the class you defined.please code in python A mining company conducts a survey of an n-by-n square grid of land. Each row of land is numbered from 0 to n-1 where 0 is the top and n-1 is the bottom, and each column is also numbered from 0 to n-1 where 0 is the left and n-1 is the right. The company wishes to record which squares of this grid contain mineral deposits. The company decides to use a list of tuples to store the location of each deposit. The first item in each tuple is the row of the deposit. The second item is the column. The third item is a non-negative number representing the size of the deposit, in tons. For example, the following code defines a sample representation of a set of deposits in an 8-by-8 grid.deposits = [(0, 4, .3), (6, 2, 3), (3, 7, 2.2), (5, 5, .5), (3, 5, .8), (7, 7, .3)]Given a list of deposits like the one above, write a function to create a string representation for a rectangular sub-region of the land. Your function should take a list of deposits, then a set of parameters…Please do in Java In many computer systems and networks,different users are granted different levels of access to different resources. In this case, you are given a int[] rights, indicating the privilege level of each user to use some system resource. You are also given a int minPermission, which is the minimum permission a user must have to use this resource. You are to return a String indicating which users can and cannot access this resource. Each character in the return value corresponds to the element of users with the same index. 'A' indicates the user is allowed access, while 'D' indicates the user is denied access. Constraints users will contain between 0 and 50 elements, inclusive. Each element of users will be between 0 and 100, inclusive. minPermission will be between 0 and 100, inclusive. Examples a) {0,1,2,3,4,5} 2 Returns: "DDAAAA" Here, the first two users don't have sufficient privileges, but the remainder do. b) {5,3,2,10,0} 20 Returns: "DDDDD"…
- A restaurant requires WAIT ADT to help waiter to wait tables. The application is required to provide functions to add a food item to the WAIT list, remove an item from the Wait list, size of the list i.e., the food items ordered, and know if item is already in the list. The WAIT ADT access time should be O [1]. Provide implementation details with your choice of data structure and the operations with justification of the constant access time. Implement search food in the added Wait list in C.In this programming exercise you will implement two functions. The first function will prompt the user for a file containing the number of vertices and entries of the adjacency matrix of a graph. It will return a two-dimensional list (a list of lists) containing the adjacency matrix. The second function will take as input the a two-dimensional list that represents the adjacency matrix of a graph, runs Prim's algorithm, and returns the list of edges in a minimal spanning tree and the total weight of the spanning tree. I have figured out the first part of the program. i need help with the second part. Thanks text file 80 1 2 3 100 100 100 1001 0 2 100 3 4 100 1002 2 0 4 4 100 5 1003 100 4 0 100 100 4 100100 3 4 100 0 3 3 3100 4 100 100 3 0 100 1100 100 5 4 3 100 0 2100 100 100 100 3 1 2 0Problem Y: Implement the reader writer problem using pthreads and semaphores. You should allow multiple readers to read at the same time and only one single writer to write to the data set. You are required to use the following: 1. A semaphore rw_muter initialized to 1. 2. A semaphore muter initialized to 1. 3. An integer reader_count initialized to 0.