Question: TheBibliographyAbstract Data Type stores references. References can be added to the bibliography or removed from the bibliography. No matter how references are represented, they are

TheBibliographyAbstract Data Type stores references. References can be added to the bibliography or removed from the bibliography. No matter how references are represented, they are ordered. Duplicate references are not allowed. You can assume that each author has just one publication and that each publication has only one author.

The ADT for aBibliographyincludes these operations:

  • new, which creates a new, empty bibliography
  • addReference, which adds a reference to the bibliography
  • removeReference, which removes a reference from the bibliography
  • outputBibliography, which generates an ordered list of references

For this part, how a reference is represented doesn't matter. The following stand-alone Python function accepts a list of references and returns a bibliography containing those references. It assumes the ADT is implemented as a Python class,

i.e. usingBibliography()as the new operation.

def makeBib(ref_list):

myBib = Bibliography()

for ref in ref_list:

myBib.addReference(ref)

return myBib

Question.

What is the best-case Big-O complexity of themakeBibfunction for an input list withnreferences? Explain your answer. Take eachBibliographyoperation as a basic step of computation.

(4 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!