logo

Crowdly

Browser

Add to Chrome

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

✅ 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

  Stack stack

  for (k = 0; k < 317 * n; k += 9)

    twoWayLinkedList.addLast(k * 2)

    stack.push(k*k*k)

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

A C

    for(j=400; j > 1; j--)        // B

      c++

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

    if(odd(i))        //

D

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

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

    else

      for(j=n/2; j < n; j++)        //

F I

        stack.push(i*j*3)        // 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