Problem Solving Through Programming In C Nptel Week 9 Assignment Answers
Are you looking for the Problem Solving Through Programming In C Week 9 Answers? You’ve come to the right place! This resource offers comprehensive solutions to the Week 9 assignment questions, focusing on fundamental concepts in C programming.
Table of Contents
Problem Solving Through Programming In C Assignment 9 (Jan-Apr 2025)
Course Link: Click Here
1. Which of the following are C pre-processor directives?
a) #ifdef
b) #define
c) #endif
d) all of the mentioned
2. What is the correct order of insertion sort (in ascending order) of the array arr[5]={8 3 5 9 4}?
a) {3 8 5 9 4} –> {3 5 8 9 4} –> {3 4 5 8 9}
b) {3 8 5 9 4} –> {3 5 8 9 4} –> {3 5 8 4 9} –> {3 5 4 8 9} –> {3 4 5 8 9}
c) {3 8 5 9 4} –> {3 4 8 5 9} –> {3 4 5 8 9} –> {3 4 5 8 9} –> {3 4 5 8 9}
d) {8 3 5 4 9} –> {8 3 4 5 9} –> {3 4 5 8 9}
3. Given an array arr = {12, 34, 47, 62, 85, 92, 95, 99,105} and key = 34; what are the mid values (corresponding array elements) generated in the first and second iterations of binary search?
a) 85 and 12
b) 85 and 34
c) 62 and 34
d) 62 and 47
Problem Solving Through Programming In C Assignment 9
4. Binary Search can be categorized into which of the following?
a) Brute Force technique
b) Divide and conquer
c) Greedy algorithm
d) Dynamic programming
5. Select the code snippet which performs unordered linear search iteratively?
a)
b)
c)
d)
6. Consider the array A[]= {5,4,9,1,3} apply the insertion sort to sort the array. Consider the cost associated with each sort is 25 rupees, what is the total cost of the insertion sort for sorting the entire array?
a) 25
b) 50
c) 75
d) 100
7. (Question text missing)
a) 0
b) 1
c) 01
d) None of the above
Problem Solving Through Programming In C Assignment 9
8. (Question text missing)
a) 10 10
b) 10 50
c) 50 50
d) Compilation error
9. What is the worst-case complexity of selection sort?
a)
b)
c)
d)
10. If the given input array is sorted or nearly sorted, which of the following algorithm gives the best performance?
a) Insertion sort
b) Selection sort
c) Bubble sort
d) Quick sort
Problem Solving Through Programming In C Assignment 9
More NPTEL Solution: https://progiez.com/nptel