Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What does the following function do for a given linked list (not empty) with first node as head? void fun1(struct node* head){ if(head == NULL){

  1. What does the following function do for a given linked list (not empty) with first node as head?

void fun1(struct node* head){ if(head == NULL){ return;}

fun1(head->next);

cout << head->data <

  1. Print all nodes of linked list
  2. Print all nodes of linked list in reverse order
  3. Print alternate nodes of linked list
  4. Print alternate nodes in reverse order

  1. Which of the following is false?
    1. The time complexity for one division is constant.
    2. The time complexity for Travelling Salesmen Problem is O(2n).
    3. The time complexity for one double write is constant.
    4. The time complexity for one integer read is constant.

  1. Which of the following Big O is most desired when designing an algorithm?
    1. O(n2)
    2. O(logn)
    3. O()
    4. O(n logn)

  1. When calculating the Big-O for an algorithm, which of the following rules is not true?
    1. Focus on the dominant
    2. Disregard any constants
    3. Focus only on polynomials
    4. None of the above

  1. Which of the following scenario has the worst O(n)?
    1. Swap two integers with the help of using a temporary variable
    2. Search a non-existence value is a degenerate binary tree with n nodes
    3. Create a new node to a BST with n nodes
    4. Execute a loop with 10000 iterations

  1. Which of the following statement is true?
    1. When using iteration and recursion to implement factorial, Big O is the same
    2. When using iteration and recursion to find Fibonacci sequence, Big O is the same
    3. When using iteration and recursion to print Pascals Triangle, Big O is the same D. None of the above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

1. What are your creative strengths?

Answered: 1 week ago

Question

Define Administration?

Answered: 1 week ago

Question

4. What actions should Bouleau & Huntley take now?

Answered: 1 week ago