Answered step by step
Verified Expert Solution
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){
- 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 <
- Print all nodes of linked list
- Print all nodes of linked list in reverse order
- Print alternate nodes of linked list
- Print alternate nodes in reverse order
- Which of the following is false?
- The time complexity for one division is constant.
- The time complexity for Travelling Salesmen Problem is O(2n).
- The time complexity for one double write is constant.
- The time complexity for one integer read is constant.
- Which of the following Big O is most desired when designing an algorithm?
- O(n2)
- O(logn)
- O()
- O(n logn)
- When calculating the Big-O for an algorithm, which of the following rules is not true?
- Focus on the dominant
- Disregard any constants
- Focus only on polynomials
- None of the above
- Which of the following scenario has the worst O(n)?
- Swap two integers with the help of using a temporary variable
- Search a non-existence value is a degenerate binary tree with n nodes
- Create a new node to a BST with n nodes
- Execute a loop with 10000 iterations
- Which of the following statement is true?
- When using iteration and recursion to implement factorial, Big O is the same
- When using iteration and recursion to find Fibonacci sequence, Big O is the same
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started