PYQBOOK

Filter Questions

Found 475 question(s)

Q436 MCQ GATE CS Medium 1 Mark 2020
DS → Linked Lists
What is the worst case time complexity of inserting n elements into an empty linked list, if the linked list needs to be maintained in sorted order?
Choose One:
Q437 NAT GATE CS Hard 2 Marks 2020
DS → C Programming
Consider the following C functions: tob() converts integer to binary array, and pp() computes an exponentiation. int tob(int b, int *arr) { int i; for(i=0; b>0; i++) { if(b%2) arr[i]=1; else arr[i]=0; b=b/2; } return(i); } int pp(int a, int b) { int arr[20]; int i, tot=1, ex, len; ex=a; len=tob(b,arr); for(i=0; i<len; i++) { if(arr[i]==1) tot=tot*ex; ex=ex*ex; } return(tot); } The value returned by pp(3, 4) is
Enter Numerical Answer:
Q438 NAT GATE CS Hard 2 Marks 2020
DS → C Programming
Consider the following C functions. int fun1(int n) { static int i = 0; if (n > 0) { ++i; fun1(n - 1); } return(i); } int fun2(int n) { static int i = 0; if (n > 0) { i = i + fun1(n); fun2(n - 1); } return(i); } The return value of fun2(5) is
Enter Numerical Answer:
Q439 NAT GATE CS Medium 1 Mark 2020
DS → C Programming
Consider the following C program: int a[4][5] = {{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15},{16,17,18,19,20}}; printf('%d', *(*(a+**a+2)+3)); return 0; The output of the program is
Enter Numerical Answer:
Q440 MCQ GATE CS Medium 1 Mark 2020
DS → Trees
What is the worst case time complexity of inserting n^2 elements into an AVL-tree with n elements initially?
Choose One: