1 Unit 1 1. Write the following statements in C :  Print the address of a float variable P. Declare and initialize an array to four characters a,b,c,d. 2. Declare a pointer to a function f which accepts integer as parameter and dose not return anything. 3. Read a string which will contain only alphabets. 4. Write a C program using pointers and functions to:  i. Read a string ii. Append a string to another string iii. Copy a string to another string. 5. Write iterative and recursive C functions to find the greatest common divisor of two integers.  6. What is pointer in C? Write the output of the following code:  main() static int a=10,20,30,40,50; int *ptr=a; static int arr=1,2,3,4; char str= ABCD * 4# ; char *s= str+2; int I,j; for(i=0;i<5,i++) printf( %d, * ptr++); for (i=0;i<2;i++) for(j=0;j<2;j++) printf( %d \,n, *(*(n+i)+j)); printf( %c\n%c\n%c\n, *(str + 2),*s++,*--s);
2 7. Write a C program to count the number of special characters and lines in a text file and append it to same file.  8. Differentiate between the following:  (i) Call by value and call by reference (ii) Structure and union. 9. What is similarity between structure, union and enumeration?  10. What is Macro? What are its advantages and disadvantages.  11. Write a C program to interchange two variables without using third variable.  12. Describe about storage allocation and scope global, extern, static, local and register variables.  13. What do you mean by type- definition? Explain with example.  14. Determine output of the following C statement:  main() int x=10,y=5,p,q; P=x>9; q=x>3 && y!=3; printf( p=% d,q= % d,p,q); main() int x; X= *8/5%10; printf( x=%d,x); 15. Write a recursive function to display nth element in Fibonacci series. With the help of stack contents give a trace of Fibonacci function by you for n=6;  16. Explain the following with example with respect to files in C : i. Fread ii. Fwrite iii. Fseek iv. Ftell v. Fopen 17. What is the difference between text files and binary files? 
3 18. Write C function to reverse the n numbers stored in one dimensional array.  19. What is recursive function? Explain with example.  20. Explain the following concept in C language with example. (i)pointer (ii)call by value (iii)array of pointers (iv)structure 21. Write a C program to perform following operations on an array of integers of size n.using functions with parameters:  (i) Delete an element at a given position (ii) Count and display the prime numbers. 22. (a) Write output of code:  #include<stdio.h> #define N 5 int main( ) Int I,j,n=N; Int *p,list=10,20,30,40,50; Char name= ABC, BCD, CDE; Char (*q); P= &list; Q=&name; for(i=0;i<n;) print( %d \t %d \n,*(list+i++),*(p++)); for (j=0;j<3;j++) printf( %s \t %c\t%d\n,name[j],*(*(q)+j),name[j]); 23. Write a C program to read and store data about n machine parts in a file. The data of each machine part consists of a part
4 24. Machine part consist of a part number, name and quantity. Write a C function to display the total quantity of all parts and the part numbers having quantity less than given value. 1. (a) Define the following terms:  Unit 2 i. Data structure ii. Pseudocode iii. Abstract data types iv. Big O notation 2. Write an algorithm to find the sum of integers in an array of size n and explain algorithm components with respect to your algorithm.  3. Explain the classification of data structures with an example each . 4. Give the basic statement constructs in an algorithm with example.  5. Write iterative algorithm to find the factorial of a number. Determine the efficiency of your algorithm.  6. Find the frequency count of each statement and each statement determine the time complexity of code given below:  Main() printf( %d,m); printf( %d,n); for (i=0;i<=m;i++) for(j=0;j<=n;j++) Count++; a+=b[count]; 7. Define Pointers? How do we declare the pointers?give its advantages. 
5 8. Diffrentiate between pass by reference and pass by value.  9. Explain the effect of following statements: 1. int p,*p; 2. int q,*p=&q; 3. int(*p)++; 4. char *p; 5. int a=*p+5; 10. What is difference between null pointer and null macro?  11. What are pointers really good for?  12. What is recursion? Explain with example.  13. Define algorithm? What are the characteristics of an algorithm?  14. What is the frequency count of following: int fact(int n) int ans=1; while(n>=1) Ans=ans*n; N=n-1; Return(ans);. 15. Find out complexity? Explain linear,non linear data structure,static and dynamic data structure.  16. What is abstract data types?write An ADT for an array?  17. Find frequency count of each step in code: int i,j; for(i=1;i<=n;i++) for (j=1;j<=n;j++) C[i][j]=a[i][j]+b[i][j]; 18. Explain Big O,Sigma and theta notation with example? 
6 19. Explain the following terms with example: i. Static data structure ii. Omega notation iii. Flow charts iv. Data object 20. Write an algorithm to find sum of odd and even int in an array of integers of size n.  21. Determine the efficiency of algorithm for finding minimum number from list using frequency count.  22. Give the classification of data structures with respect to memory allocation and relation between elements.  Unit 3 1. Write an ADT for polynomial. Write pseudocode for 2-polynomial addition using arrays. Find out time complexity of it.  2. Derive the formula to calculate the address of the element in one-dimensional and twodimensional array using row major representation.  3. Explain the steps of fast transpose algorithm for getting the transpose of sparse matrix having maximum m rows and n columns. What is the time complexity and space complexity of it? What are the advantages of fast transpose over simpletranspose?  4. Write an ADT for sparse matrix.  5. What is row major and column major storage representation methods of an array?  6. What is call by value and call by reference? Explain with one example for each.  7. Write a C program to shift elements of an integer array one location ahead. Element present at last location of array should be shifted on first location of the array. Write separate functions for accepting array, shifting array, displaying array etc.  8. Explain execution of the following code step by step and show the final output :  # include < stdio.h > void display (int); int main( ) int x = 4;
7 display (x); return 0; void display (int n) if (n > 0) display (n 1); printf ( %d, n); 9. Write a C program to implement a structure for automobile part with data members part number, part name, quantity etc. Write separate functions for initializing structure, updating structure, displaying structure etc.  10. Wtite polynomial as ADT.Represent the following polynomials using Array: 5x 11. Write Psedo C algorithm to find the fast transpose of a sparse matrix.analyse the time complexity of the algorithm. 12. Derive the address calculation formula for multidimentional array, A[u1][u2]..[un] in row major and coloumn majior representation. 13. Justify array as a linear data structure.write ADT for an array 14. Write psedo c algorithm to add two polynomials represented using array and analyse the time complexity 15. Explain the representation of sparse matrix with an example and state its advantages. 16. Define time and space complexity of an algorithm 17. Explain with the example linear data structure 18. Define the following terms:  (i)data object (ii)data type 19. What is an abstract data type?  20. Define data structure.what are different types of data structure? Explain.
8 21. Explain different asymptotic notation. 22. What do you mean by frequency count and its importance in the analysis of algorithm UNIT 4 1. Write pseudocode for searching an element in a given array using linear search. What is the time complexity of linear search in best case, average case and worst case? Explain with example.  2. Write a pseudocode for quicksort to sort a given array of n numbers. Show the contents of an array after each iteration for the following array : What is worst case and average case time complexity of quicksort?  3. Write an algorithm for shell sort. Apply your algorithm to sort the following numbers in ascending order. Show the contents of an array after every iteration : What is time and space complexity of shell sort?  4. Write pseudocode for Fibonacci search. Apply your algorithm on the following data to search numbers : 9, 100, 10.  Explain Generalized Linked List (GLL) with node structure in C. Represent the following using GLL : (a, b, c, (d, (e, f, c)), g), h, i).  6. Write a function to create singly linked list which is sorted while creation.  7. Explain in detail the concept of data object, data structures, linear data structure and nonlinear data structure.  8. What is Asymptotic notation? Write an algorithm for matrix multiplication for n n matrix and find out its time complexity by frequency count.  9. What is Abstract Data Type (ADT)? Write an abstract data type for linked list. 
9 10. Write an algorithm for Bubble sort. Find time complexity of the algorithm and express it using asymptotic notation.  11. Sort the following numbers step by step by using Radix sort :  20, 15, 21, 06, 08, 05, 29, 02, 14, Write an algorithm for binary search and find out its time complexity.  13. Explain with one example index sequential search.  14. Write a C program to implement quicksort.  15. Give any two application of sorting and searching. 16. Write psedo c algorithm for merge sort and determin its time Complexity. 17. write psedo c algorithm to search an element using binary search and analyze its time complexity for best and worst cases. 18. Write psedo C algorithm for insertion sort and determine its time complexity . 19. Write the contents of list and each bucket,after each pass radix sort for the following list of numbers: 10,2,15,246,37,4,25,62,100,17.  20. What is sort efficiency and sort stability? 21. Compare the selection sort and inserton sort with respective to:  (i) Time Complexity (ii)passes(iii) Storage requirement (iv) Sort stability 22. Sort the following data in asending order using quick sort Show all passes with pivot: 56,12,84,56,28,0,-13,47,94,31  23. Write the different application of sorting methods. 24. Write psedo code for binary search with recursion. 25. What is bubble sort? Explain with example  Unit 5 1. Explain Generalized Linked List (GLL) with node structure in C. Represent the following using GLL : (a, b, c, (d, (e, f, c)), g), h, i).  2. Write a function to create singly linked list which is sorted while creation.  3. Represent the following polynomial equation in Generalized Linked List (GLL) :
10 10x4y10z3 + 4x7y10z3 + 5x7y10z3 + x3y10z2 + 8x3y10z2 + 8y10. Also give the importance of the tag field in this representation.  4. Write short note on garbage collection and compaction.  5. Write a function to display the singly linked list in reverse without creating new.  6. Show how a two-dimensional array is stored in memory. Assume that array start at the address  7. Explain how a polynomial is represented using array with one example.  8. Write an algorithm for fast transpose of sparse matrix and find out its time complexity.  9. Write a C program to implement polynomial using array and perform its multiplication. (Write separate functions for accepting polynomial, multiplication, display).  10. What is sparse matrix? Explain with one example.  11. (ii) What is address of element arr  in the array arr of size 6 6 and type integer, when arr is represented using row major and column major representations? Assume array arr starts at the address What is static memory allocation and dynamic memory allocation?  13. Compare doubly linked list and circular linked list.  14. Write an algorithm to delete and insert a node in doubly linked list at any position.  15. What is skep list? Explain with one example.  16. Draw GLL for the following expression :  (a, b, (c, d, (e, f), g, (h, i), ((j, k)), l), m) 17. What a C program to implement circular linked list and display the contents in reverse order. (Write separate functions for create and display)  18. What do you mean by dynamic memory allocation?how is it done in c? 19. Write c Function for create, insert at end,delete a given node and display list,operations on a singly linked list. 20. Write a C function to concatenate two circular linked list. 21. Represent the following polynomial using circular linked list: (i)12x 6-2x 5-3x + 10 (ii)3x7 + 5x 2 + 2x  22. What is Doubly linked list? Explain any two application of doubly linked list.
11 23. Write C function for the following operations by choosing appropriate linked list: (i)to search a given element in list (ii) to traverse the list from any node. 24. Represent the following polynomial using arrays: (i)x 3 + 2xy 5 - y 3 y +x (ii)5x 2-10xy-y Write a short note on Storage representation of order list. 26. Write Pseudo C algorithm for addition of two polynomials  27. Explain with the example simple and fast transpose  Unit 6 1. Write a short note on Josephus problem.  2. Write an ADT for stack.  3. Convert the following infix expression into postfix expression by showing the contents of stack for every iteration : ((A/B Ù C) + (D * E)) (A * F)). Evaluate the postfix expression obtained for A = 9, B = 3, C = 2, D = 3, E = 17, F = 3.  4. List any four applications of stack and explain any one of them.  5. Explain the concept of multistack with example.  6. Convert the following postfix expression to infix and prefix using stack. Show the contents of stack at every stage : abcde Evaluate given postfix expression for a = 50, b = 3, c = 4, d = 2, e = 1. . 7. Sort the following numbers step by step by using Radix sort :  20, 15, 21, 06, 08, 05, 29, 02, 14, Write an algorithm for binary search and find out its time complexity.  9. Define stack.write algorithms for operation on a stack represented using array. 10. Write pseudo C algorithms for operation on a stack represented using array 11. Write psedo c algorithm to convert infix expression to postfix expression using linked stack. 12. Write a c function to reverse a given string using stack. check a given is palindrome or not, using this function.
12 13. Define queue.write linear queue as ADT using linked organization. 14. How the circular queue solves the problem in linear queue?give the representation of circular queue using array and linked list. 15. Write short note on the following:  (i) Queue Simulation (ii) Priority Queue 16. Write C pseudo code to insert and delete an element from singly linked list  17. compare linked list with arrays with reference to the following aspects: (i) accessing any element randomly (ii) insertion and deletion of an element (iii) utilization of computer  18. Discuss the application of circular singly linked list in detail 19. Write comparison between sequential linked organization with linked organization  20. Represent the following GLL: (i) G=((a,b)((c,d),e)) (ii)(p,q(r,s(t,u,v),w)x,u) 21. Write C function that removes all duplicates element from SLL.