subject

1. (60 pts.) Analyzing Code. For each of the following, answer parts a-e. a.) (5pts.) Is the code correct? If not, provide a counterexample. b.) (3pts.) What is the asymptotic worst-case time complexity of the code. c.) (2pts.) What is the asymptotic worst-case space complexity of the code. d.) (3pts.) What is the asymptotic best-case time complexity of the code. e.) (2pts.) What is the asymptotic best-case space complexity of the code. i.) (15pts.) Maximum element (note this code is not the same as in the example in Notes3) double Max(double a[], int b, int e) { if (b>=e) { return a[b]; } else { int m=(b+e)/2; return(fmax(Max(a, b, m), Max(a, m+1, e))); } } // The following is the top level call to Max. // Returns the largest element in a. There are n elements in a[] double Max(double a[], int n) { return(Max(a, 0, n-1)); } ii.) (15pts.) Sequential Search version 1 int Find(double x, double a[], int b, int e) { if (b>=e) { if (a[e]==x) { return(e+1); } else { return(0); } } else { int m=(b+e)/2; int res=Find(x, a, b, m)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
Data is processed, stored, and transmitted as a series of 1s and 0s. each 1 or 0 is called a(n) . a series of eight 0s and 1s, called a(n) , represents one character—a letter, number, or punctuation mark. data becomes when it is presented in a format that people can understand and use. digital signals are represented by two different , such as +5 volts and +.2 volts. digital data can also take the form of light and dark spots etched onto the surface of a cd or the positive and negative orientation of particles on the surface of a hard disk. data consists of numbers that might be used in arithmetic operations. it can be represented digitally using the number system. data is composed of letters, symbols, and numerals that are not used in arithmetic operations. computers represent this type of data using , ebcdic, unicode, or utf-8. data is quantified using terms such as or kibibyte (1024 bytes), and prefixes such as or mebi (1,048,576), and giga or (1,073,741,824). to reduce file size and transmission times, digital data can be compressed. compression provides the means to compress data and reconstitute it into its original state. compression throws away some of the original data during the compression process. compressed files usually have at the end of the file name and are represented with special icons. these files have to be or unzipped before you can view the data they contain.
Answers: 1
question
Computers and Technology, 22.06.2019 07:00
Idon understand these and need some ! ?
Answers: 2
question
Computers and Technology, 23.06.2019 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
question
Computers and Technology, 23.06.2019 13:10
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
You know the right answer?
1. (60 pts.) Analyzing Code. For each of the following, answer parts a-e. a.) (5pts.) Is the code co...
Questions
question
Geography, 20.08.2019 11:00
question
Mathematics, 20.08.2019 11:10
Questions on the website: 13722361