1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
slavikrds [6]
3 years ago
8

Express the worst case run time of these pseudo-code functions as summations. You do not need to simplify the summations. a) fun

ction(A[1...n] a linked-list of n integers) for int i from 1 to n find and remove the minimum integer in A endfor endfunction
Computers and Technology
1 answer:
ser-zykov [4K]3 years ago
5 0

Answer:

The answer is "O(n2)"

Explanation:

The worst case is the method that requires so many steps if possible with compiled code sized n. It means the case is also the feature, that achieves an average amount of steps in n component entry information.

  • In the given code, The total of n integers lists is O(n), which is used in finding complexity.
  • Therefore, O(n)+O(n-1)+ .... +O(1)=O(n2) will also be a general complexity throughout the search and deletion of n minimum elements from the list.
You might be interested in
How to call a void method with no parameters IN JAVA?
natka813 [3]

Explanation:

SanfoundryMenu

Java Program to Illustrate a Method without Parameters and Without Return Type

« PrevNext »

This is a Java Program to Illustrate a Method without Parameters and Without Return Type.

We have made the method to calculate area. We call this method from main method and then enter the radius of the circle as input. Now we calculate area and print the output.

Here is the source code of the Java Program to Illustrate a Method without Parameters and Without Return Type. The Java program is successfully compiled and run on a Windows system. The program output is also shown below

6 0
3 years ago
Because its radio waves can pass through walls or desktops,
jeka57 [31]
Bluetooth i believe, not too sure however but its ur best bet
5 0
3 years ago
Write a SELECT statement that returns these columns from the Products table: The list_price column The discount_percent column A
Anarel [89]

Answer:

Check the explanation

Explanation:

The SELECT statement that returns these columns are:

SELECT

   list_price,

   discount_percent,

   ROUND (list_price * discount_percent / 100,2)  AS discount_amount

FROM

   products;

----------------------------------------------------------------------

6 0
3 years ago
B. Write your thoughts about the following in your notebook.
tankabanditka [31]

1. stay with adult supervision

2. check on the web and create a site for it

3. quickly remove it and try not to read it

Explanation:

I really hope this helps

please mark as brainliest

4 0
3 years ago
Write two recursive versions of the function minInArray. The function will be given a sequence of elements and should return the
Viktor [21]

Answer:

Following are the code to this question:

#include <iostream>//defining header file

using namespace std;//using namespace

int minInArray1(int arr[],int arrSize)//declaring method minInArray1

{

if(arrSize == 1)//use if block to check arrSize value is equal to 1  

{

return arr[0];//return first element of array

}

else //defining else block

{

int max= minInArray1(arr, arrSize-1);//use integer variable max to call method recursively  

if(arr[arrSize-1] < max)//use if block to check array value  

{

max = arr[arrSize-1];//use max to hold array value

}

return max;//return max variable value

}

}

int minInArray2(int arr[], int low, int high)//defining a method minInArray2  

{

if(low == high) //use if to check low and high variable value are equal

{

return arr[low];//return low variable value

}

else //defining else block

{

int minimum = minInArray2(arr, low+1, high);//defining integer variable minimum to call method minInArray2 recursively

if(arr[low] < minimum)

{

minimum = arr[low];//use minimum variable to hold array value

}

return minimum;//return minimum value

}

}

int main()//defining main method

{

int arr[10] = { 9, -2, 14, 12, 3, 6, 2, 1, -9, 15 };//defining an array arr

int r1, r2, r3, r4;//defining integer variable

r1 = minInArray1(arr, 10);//use r1 variable to call minInArray1 and hold its return value

r2 = minInArray2(arr, 0, 9);//use r1 variable to call minInArray2 and hold its return value

cout << r1 << " " << r2 << endl; //use print method to print r1 and r2 variable value

r3 = minInArray2(arr, 2, 5);//use r3 variable to call minInArray1 and hold its return value

r4 = minInArray1(arr + 2, 4); //use r4 variable to call minInArray2 and hold its return value

cout<<r3<< " " <<r4<<endl; //use print method to print r3 and r4 variable value

return 0;

}

Output:

please find the attached file.

Explanation:

In the given code two methods, "minInArray1 and minInArray2" is defined,  in the "minInArray1" it accepts two-variable "array and arrSize" as the parameter, and in the "minInArray2" method it accepts three integer variable "array, low, and high" as the parameter.

  • In the "minInArray1" method, and if the block it checks array size value equal to 1 if the condition is true it will return the first element of the array, and in the else block the max variable is defined, that calling method recursively
  • and store its value.
  • In the "minInArray2" method, an if the block it checks low and high variable value is equal. if the condition is true it will return a low array value. In the next step, the minimum value is defined, which checks the element of the array and uses a low array to store its value.
  • In the main method an array and four integer variable "r1, r2, r3, and r4" is defined, which calls two methods "minInArray1 and minInArray2" and use print method to print its value.
7 0
3 years ago
Other questions:
  • Working for the Internal Revenue Service is a career in public safety. A. True B. False
    14·1 answer
  • A digital designer might do computer animation or video games true or false
    13·2 answers
  • After the closing entries have been posted:
    10·1 answer
  • What is a client benefit of partnering with Accenture's Intelligent Platform Services<br> (IPS)?
    10·1 answer
  • When measuring processor speed,a megahertz is much faster than a gigahertz.true or fals
    12·1 answer
  • Which program will have the output shown below?
    12·2 answers
  • Which function works best when you need to remove an element at a specific index in a list?
    11·1 answer
  • 1) "Information systems are revolutionizing the way businesses function in the 21st century," Do you agree or disagree with this
    5·1 answer
  • Identify the type of error.<br> print "hello"<br><br> num = 5 / 0
    11·2 answers
  • Exam Instructions
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!