logo

Crowdly

Browser

Add to Chrome

int find_c(int n)   int i,j,c   TwoWayLinkedList twoWayLinkedList   Max...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

int find_c(int n)

  int i,j,c

  TwoWayLinkedList twoWayLinkedList

  MaxHeap heap

  for (k = 0; k < 716 * n; k += 12)

    twoWayLinkedList.addLast(k * 2)

    heap.add(k / 0.5)

  for(i=n; i > 1; i=i/2)        //

A C

    for(j=n*n; j > n/2; j--)        // B

      c++

  for(i=c; i > 0; i--)

    if(even(i))        //

D

      for(j=n; j < n*n; j++)        // E J

        twoWayLinkedList.find(i+j+c)        // G

    else

      for(j=0; j < 3*n; j++)        //

F I

        heap.dequeue()        // H

  return c

Mis on antud algoritmi halvima juhu kogukeerukus O-notatsioonis sõltuvalt sisendparameetrist n: (Liigne vastus on see, mis jääb üle)

NB! Ka liigse vastuse lahter tuleb täita punktide saamiseks!

A -> tsükli korduste arv

B -> tsükli keerukus kokku

C -> tsükli keerukus kokku

D -> if-else keerukus kokku

E -> tsükli korduste arv

F -> tsükli korduste arv

G -> operatsiooni keerukus

H -> operatsiooni keerukus

I -> tsükli keerukus kokku

J -> tsükli keerukus kokku

More questions like this

Want instant access to all verified answers on moodle.taltech.ee?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome