What is the purpose of using asymptotic notation such as o

Assignment Help Computer Engineering
Reference no: EM131314628

Assignment

SECTION 1. Algorithm Analysis

TO DO WELL: Before you work on this section, write down what W(N) means, and the F(N)s of sorting and searching.

1) What is the purpose of using asymptotic notation such as O, Omega and Theta instead of using the exact number of comparisons done by a sorting algorithm?

i.e. why do we use O(n^2) instead of saying 2n^2 + 3n + 4

*Because we are only interested in

2) Computing the Average time complexity for a real-world problem is difficult. Explain why by referring back to the formula for computing A(n). Why?

3) Your friend is very excited about having found a sorting algorithm that sorts in much less than W(n) = Theta(N^2)comparisons even though it corrects only one bad pair per comparison. He thinks this is the fastest sort ever and that he will get a Ph.D. tomorrow. Please teach him why he is wrong.

4) Your friend says she can find a comparison based algorithm that searches for an element in an ordered list in much less than W(N) = Theta(log N). Please teach her why she is wrong.

5) Name 2 Divide and Conquer algorithms we studied in this class.

6) Describe 2 Space vs. Time decision cases we discussed in this class.

In what ways can each be called Space vs. Time?

7) Name 2 greedy algorithms we have learned in this class.

SECTION 2. Sorting

Your mean employer has five sorting programs. But they are labeled by their descriptions - no names.

Read each label then say which of the following it is:

Heap Sort
Insertion Sort
Merge Sort
Quick Sort
Radix Sort

1) "I am a good choice if you want consistent theta(nlogn) time and have lots of space."

2) "Although I take O(n^2) time in the worst case, on the average

I only use theta(nlogn) and I do not need as much space as another divide and conquer algorithm."

3) "I use theta(nlogn) time in the worst case. The data structure I use is also useful for efficiently implementing priority queues."

4) "Even though my average complexity is theta(n^2), I am a good choice if you want to sort small files, or large files that are very nearly in order."

5) "I am a good choice if you want to quickly sort a large number of K digit numeric IDs."

SECTION 3. Object-Oriented Programming

TO DO WELL: Before you work on this section, re-read the notes.

1) (inheritance), we placed data members of the base class in protected. Why did we do that? Answer each separately.

*Why not private?

*Why not public?

2) You had to overload = to make it work with slists.

*We had to overload=. What's wrong with the one provided by C++?

*We had to overload==. What's wrong with the one provided by C++?

3) Why did you have to write a copy constructor for linked lists?

Also, give two cases in which your copy constructor is automatically invoked in relation to calling regular functions.

*What's wrong with the one provided by C++?

*Invoked when:

*Invoked when:

4) Why is it useful to use virtual functions with inheritance and pointers? Explain using the Animals array which contains pointers to Dog and Cat objects with a virtual function Speak.

*The stated combinations allows

SECTION 4. Binary Search Trees

void BST::traverse(Vertex *V) // post order traversal recursively
{
if (V != NULL)
{
traverse(V->Left);
traverse(V->Right);
cout << V->elem << endl;
}
}

1) Modify the above slightly (just re-order) to do the Depth First traversal recursively. What is this traversal called?

*Code:

*Name of the traversal: ____________ order traversal.

2) Why would we want to balance search trees?

(i.e. What is wrong with unbalanced trees?)

What were the two ways (from our notes) of having a balanced search tree?

*Why:

*Way1:

*Way2:

SECTION 5. GRAPHS: Islands and Bridges

800 islands are connected with many two-way bridges (i.e. lines, not arrows).

You know the cost of maintaining each bridge.

You want to minimize the total maintenance cost by eliminating some bridges while leaving all the islands connected.

1) What algorithm would you use to solve this problem? (Algorithm for finding what?)

*Algorithm for finding:

2) How many bridges will you end up with if you used this algorithm?

*Give the Formula where N = 800:

SECTION 6. ENCYPTION and BIG DATA (from Notes-14)

*Fill in the blanks in the following:

Encryption in essential in cybersecurity.

Using RSA, if people want to send messages to Mary, they have to use her ______ encryption key. She uses her ______ decryption key to decode them.

_______ numbers play an important role in constructing these keys.

The computer can use big training data to learn to identify or classify things.

By analyzing a vast number of examples labeled with their categories, the computer will learn to place unlabeled ones into these categories. This area of Artificial Intelligence is called _________ learning.

SECTION 7. MEMORY

1) What are garbage cells? i.e. What kind of cells are they and why do they happen? (Recall that there are 3 kinds of cells and garbage cells are just one of them)

*What are they?

*Why do they happen?

2) Which garbage collection method from the notes worked incrementally and also prevented dangling pointers?

*Method:

SECTION 8 NP vs. P Consulting Job

1) Your boss says "I want you to find the shortest path that passes through all the Mars alien bases. The objective is to infect each base and thus you cannot return to the same base ever again. I want an algorithm to do it in Polynomial time."

*What would you say to him? Explain why:

2) 10 years from today, while sleeping, you find a polynomial time algorithm for bin packing. Congratulations!! What implication does this have on your answer to the question above? What famous question have you answered to make you rich?

Reference no: EM131314628

Questions Cloud

What are the minimum and load currents : A zener diode regulator in the fig is to be designed to meet the specification IL = 10mA.Vo = 10V and Vin varies from 30V to 50V.The zener diode has Vz = 10V and knee current Izk = 1mA. Find the minimum, value of R for satisfactory operation
Is anything puzzling about falk''s pricing pattern : For tooth whitening, a process requiring 30 minutes, Falk charges $150 net of materials. Again, no help is required. Is anything puzzling about Falk's pricing pattern? Explain your answer.
What is the reorder point : Daily demand of a product is 20. The lead time is estimated to 6 days. If the desired safety stock is 30 units, what is the reorder point?
Estimate the number of molecules per cubic inch : Using the information given in Problem and the properties of the standard atmosphere given in Appendix G, estimate the number of molecules per cubic inch at an altitude of 250,000 ft.
What is the purpose of using asymptotic notation such as o : What is the purpose of using asymptotic notation such as O, Omega and Theta instead of using the exact number of comparisons done by a sorting algorithm?
Employee to answer the customer : The mean service rate (how long it takes the call center employee to answer the customer's question) is 30 customers per hour (most customer questions can be answered rather quickly) and follows an Exponential distribution.
What is the opportunity cost of a pot holder : For Kristen and for Anna, what is the opportunity cost of a pot holder? Who has a comparative advantage in the production of pot holders? Explain your answer.
What are the advantages of playing video games : What are the advantages of playing video games ?What are the disadvantages of playing video games?Even though video games players have shown instances of aggressive thoughts in a study done in Singapore, playing video games leads to addiction and ..
What is the project completion time : What is the critical path for this project, what is the project completion time, how much total work time (in days) is required for this project, and what is the cost for completing this project using the Activity Time?  Also identify the slack ti..

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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