Which of the given functions has a constant growth rate

Assignment Help C/C++ Programming
Reference no: EM131380036

Question 1.Which of the following functions has a constant growth rate?
n
n2
n log n
1

Question 2. An algorithm is _____.
a finite collection of steps to solve a problem
a program
a programming function
a mathematical formula

Question 3. The running time of an algorithm is _____.
the time, in milliseconds, it takes to complete its execution
the running time of its implementation
the maximum number of basic operations executed by the algorithm (over all inputs of size N)
the number of steps given in its description

Question 4. The following function returns the _____ of the array elements.

int mystery(int a[], int n)
{
int x=a[0];
for (inti=1; i<n; i++)
if (x > a[i]) x = a[i];
return x;
}

maximum
minimum
middle element
sum

Question 5. Consider the recursive function below:

intRecFunction(int n)
{
if (n==0) return 0;
else return RecFunction(n-1) + n;
}

What is the output in the statement cout<<RecFunction(2); ?
0
1
2
3

Question 6. Consider the function below:

long x(int n)
{
if (n == 1) return 1;
else return n*x(n-1);
}

What will be displayed by the cout statement cout<< x(3) <<endl; ?
720
25
6
1

Question 7.The running time of bubble sort is __________.
O(n log n)
O(log n)
O(n)
O(n2)

Question 8. A method that performs very well in practice, even though its worst-case running time is quadratic, is __________.
bubble sort
insertion sort
mergesort
quicksort

Question 9. The running time of an algorithm to find the sum of a list of k values is __________
O(1)
O(k)
O(log k)
O(k log k)

Question 10. Consider the recursive function below:

long myFunction(int x)
{
if (x==0 || x==1) return x;
else return myFunction(x-1) + myFunction(x-2);
}

What will be displayed by System.out.println(myFunction(3));?
0
1
2
3

Question 11. In each step, the __________ method divides the list to be sorted into two parts of equal size.
bubble sort
insertion sort
quick sort
merge sort.

Reference no: EM131380036

Questions Cloud

What is the purpose of audit risk assessment : What is the purpose of audit "risk assessment"? What are its objectives, and why is it important in assessing the likelihood that fraud may occur?
Apply corporate communication concepts : Purpose of assignment is to apply corporate communication concepts, especially the notion of comprehensive strategic communication, to your own professional situation.
Evaluate the four risk-mitigation options and strategies : Explain how ITPM best practices can facilitate process change within an organization. Determine if ITPM would be used differently depending upon the industry in which it was used. Explain your answer.Evaluate the four risk-mitigation options and st..
Explain the content of each section of the audit report : Explain the content of each section of the audit report. Evaluate the importance of each section with respect to the users of financial reports.
Which of the given functions has a constant growth rate : Which of the following functions has a constant growth rate? What is the output in the statement cout
How scatterplot could still reveal the strong association : He had expected to find a fairly strong association, yet the correlation was near 0. Discouraged, he didn't bother making a scatterplot. Explain to him how the scatterplot could still reveal the strong association he anticipated.
What stage of moral development in kohlbergs model is best : How might the employee justify her actions if questioned by the auditor with respect to no harm and no responsibility? What stage of moral development in Kohlberg's model is best illustrated by the employee's actions? Why?
Explain the correlation between business value-project cost : Assess business continuity planning (BCP) as a process that adds business value. Explain the correlation between business value and project cost estimation as they relate to BCP. List and support three business justifications for business value o..
Government policies can affect frictional : Government policies can affect frictional and structural unemployment in either ways. Which policies can increase these two types of unemployment? Which of the following is the prevailing view of economists about unemployment insurance program in the..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd