hi i need to solve questions with details please
Q1) Find the time complexity (0-notation, e-notation and Q-notation) for the following selection sort algorithm: [10 marks] void fun (int a[], int n) { int i,min; for(i=0;i<n-1;i++) ( min-minimum(a,n.i); swap(a,a[min]); } } int minimum(int a[],int n,int i) ( int j; int min-i; for(j=i+1:j<n;i++) if (a<a[min]) min-j; return min;} Q2) What is the output of the following function? Justify your answer by drawing the tree of the divide and conquer technique: start-0, end-7 marks] [10 consider int a[8]=(4,8,9,3,6,5,15,21; int fun2(int b) { for(int i=2;i<=b/2;i++) if (b%i--0) return i; return 1: } int funl (int a[], int start, int end) {if(start--end) return fun2(a[start]); int mid= (start+end)/2; return fun1 (a,start,mid) + fun1 (a,mid+1,end); Q3) Given the following 6 activities with start and finish time (s,,f), use the greedy algorithm to find the maximum number of activities without any overlapping between start and finish time. [10 marks] activities Q4) Given the foll message, use Huffman coding to compress the message. [10 marks] The message: "AAABBBBBCDDDDDDDDDDEEEECFFFFFFFF" Q5) Use the backtracking strategy to fill the following Sudoku: [10 marks]
hi i need to solve questions with details please
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am