You are on page 1of 7

A Program File on

Data Structure through C Language Lab


[BCA 351]

Submitted for partial fulfillment of Award of


BACHELOR IN COMPUTER APPLICATIONS Degree

TEERTHANKER MAHAVEER UNIVERSITY, MORADABAD

2012 13

GUIDED BY:

SUBMITTED BY:

Dr. Kapil Govil Mr. Rupal Gupta (TMU Roll No. Section: C )

Class Roll No.:

-1-

Student Performance Sheet

Subject Name: Subject Code:

Data Structure through C Language Lab BCA 351

Student Name: Student Roll No:

No. of Assignment No I II III IV V VI VII VIII IX X Date of Issue Questions 13/08/2012 13/08/2012 13/08/2012 13/08/2012 13/08/2012 13/08/2012 13/08/2012 13/08/2012 13/08/2012 13/08/2012 13 18 2 1 8 8 2 4 3 5 Submission date

Faculty Remark/Grade Signature

Lab Faculty 1. 2. Dr. Kapil Govil Mr. Rupal Gupta

-2-

Contents
S. No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Question 1 Question 2 Question 3 Question 4 Question 5 Question 6 Question 7 Question 8 Question 9 Question 10 Question 11 Question 12 Question 13 ASSIGNMENT II: ARRAY Question 14 Question 15 Question 16 Question 17 Question 18 Question 19 Question 20 Question 21 Question 22 Question 23 Question 24 Question 25 Question 26 Question 27 Question 28 Question 29 Question 30 Question 31 ASSIGNMENT III: STRUCTURE Question 32 Question 33 ASSIGNMENT IV: SEARCHING Question 34 ASSIGNMENT V: SORTING Question 35 Question 36 Program Number Page No ASSIGNMENT I: GENERAL Date Sign

-3-

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

Question 37 Question 38 Question 39 Question 40 Question 41 Question 42 ASSIGNMENT VI: STRING Question 43 Question 44 Question 45 Question 46 Question 47 Question 48 Question 49 Question 50 ASSIGNMENT VII: LINKED LIST Question 51 Question 52 ASSIGNMENT VIII: STACK Question 53 Question 54 Question 55 Question 56 ASSIGNMENT IX: QUEUE Question 57 Question 58 Question 59 ASSIGNMENT X: TREE Question 60 Question 61 Question 62 Question 63 Question 64

-4-

ASSIGNMENT I: GENERAL
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. WAP to compute the average of given real numbers using all loops. WAP to calculate the sum of First & Last digit of a Number. WAP that take the integer number from user and check it is palindrome or not. WAP to print the table from 1 to 10 using all loops. WAP to calculate the factorial of a number. WAP to calculate the factorial of a number using recursion. WAP to implement the Formula n C r. WAP to print the Pascal Triangle. WAP to find the number is prime or not. WAP to print the following sequence of numbers 0,1,1,2,3,5,8,13,21,34.. WAP to print the following sequence of numbers using recursion 0,1,1,2,3,5,8,13,21,34.. WAP that execute on basis of Command Line argument. WAP that allocates the Memory at Runtime to any structure pointer then take input & display the record.

ASSIGNMENT II: ARRAY


14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. WAP for finding sum and average of number of array .The number should be given by the user using recursion. WAP to find the maximum element in an array A of size n (using recursion). WAP to find the minimum element in an array A of size n (using recursion). WAP to merge the two arrays A and B of size m and n respectively in one sorted array C of size M + N. WAP to print the sum of the diagonal element of the M*N square matrix. WAP to find the maximum element in a array & find how many times it is coming in a array of size n. WAP to print the transpose of m*n matrix using pointer. WAP to calculate sum of the element of two square matrix pointer. WAP to calculate product of the element of two square matrix using pointer. WAP to find the maximum element in an array A of size n (using all loops). WAP to find the minimum element in an array & find how many times it is coming in an array of size n. WAP using function to perform the multiplication of matrix by scalar quantity using pointer. WAP to find the maximum & minimum element in a matrix using pointers. WAP to add two M x N matrix using pointer. WAP to delete the specified element from an array A of size N & after that form new array. WAP to search an element in integer array, if found then return the position of element of array else return -1. WAP to search an element in integer array, if found then return the position of element of array else return -1 (using recursion).

-5-

31.

WAP which find whether a matrix, input by the user is Magic square or not.

ASSIGNMENT III: STRUCTURE


32. WAP that take the details of the Student (Std_name, Std_roll, Std_course, Std_marks of three subjects). Then show the show the details of the student as well as their Percentage. WAP that take the details of the Employee (Enamel, Empno, Empdeptno, Empsal, Empmgr, Empjob) through pointer.

33.

ASSIGNMENT IV: SEARCHING


34. WAP to search an element using Binary Search Method.

ASSIGNMENT V: SORTING
35. 36. 37. 38. 39. 40. 41. 42. WAP to sort an array of given numbers in descending order using selection sort method. WAP to sort an array of given numbers in ascending order using selection sort method. WAP to sort an array of given numbers in ascending order using bubble sort method. WAP to sort an array of given numbers in descending order using bubble sort method. WAP to sort an array of given numbers in ascending order using Insertion sort method. WAP to sort an array of given numbers in ascending order using Quick sort method. WAP to sort an array of given numbers in ascending order using Heap sort method. WAP to sort an array of given numbers in ascending order using Two-way Merge Sort method.

ASSIGNMENT VI: STRING


43. 44. 45. 46. 47. 48. 49. 50. WAP a program to check a given string is palindrome or not (the user should give the string. WAP for comparison of two string without using strcmp () function. The user should give the string. Find the substring in a string. The string & the length & the starting position of the substring are given by user. WAP to calculate the length of string without using library functions. WAP to reverse the string without using library function. WAP to concatenate the two strings without using library function. WAP to copy one string to another string without using library function. WAP which will read a text & count all occurrences of a particular word in given string.

-6-

ASSIGNMENT VII: LINKED LIST


51. WAP for making a linear linked list with following operation: (1) Insertion (at beginning, at End, at particular position, after particular position, before particular position) (2) Deletion (at beginning, at end, particular position, particular element) (3) Traverse in Reverse order. (4) Search an element (5) Sort the elements. WAP with above operations for the doubly linked list.

52.

ASSIGNMENT VIII: STACK


53. 54. 55. 56. WAP to perform push & pop operation on the stack. Check the underflow & overflow condition using array. WAP a program to evaluate a postfix expression. WAP to convert infix to post fix expression. WAP to convert infix to pre fix expression.

ASSIGNMENT IX: QUEUE


57. 58. 59. WAP to implement the Queue using Array. WAP to implement Circular Queue with array. WAP to implement the priority Queue.

ASSIGNMENT X: TREE
60. 61. 62. 63. 64. WAP to search the element in a Binary search tree. WAP for Tree Traversal in Pre-order. WAP for Tree Traversal in In-order. WAP for Tree Traversal in Post-order. WAP to insert and delete a node from the BST. (NOTE: Make a single program for all operations of a BST)

-7-

You might also like