Content feed Comments Feed
YOUR ADSENSE CODE HERE ... 728 X 90

DSA LAB ASSIGNMENT

Posted by test1 Thursday, October 22, 2009

          

                                                           DSA LAB ASSIGNMENT

                                                 III SEM(CP)

 

   Q1.WAP in C to sort a array using buble sort and search a element in array using binary seach.if the no is in array then return the positin of element and if the no is not in array then insert it in a appropriate position

 

a). Insertion ()

b). Selection ()

c). Bubble ()

 

Q3 Implement a C code to find the maximum length of palindrome from the given string. For example if the input is XxZzYyYz then the output is 5 since the palindrome in the string is zYyYz.

 

Q4.WAP in C to search a Pattern in a String.

 

Q5. Implement KMP string matching algorithm.

 

Q6.Implement a Singly Linked List with following functions :-

      Insertion()

      InsertAt()

      Deteion()

      DeleteAt()

      Reverse()

      Sort()

 

Q7 Write a program to partially reverse the linked list depending upon n (< length of linked list). [Hint: If n=2 then A=1 3 6 8 9 2 10 then output becomes B=3 1 8 6 2 9 10 and if n=3 then A becomes B=6 3 1 2 9 8 10].

 

Q8.WAP in C to merg two linklist in a single list.the final list should be in a sorted fashion.

 

Q9 WAP in C to implement a stack using:-

       1.Array

       2.Linklist

 

Q10. Using the stack from Q (10), write a method/function called evaluate,which evaluates a postfix expression, passed as the first command-line argument ( argv[1] in C). The expression will be of the form (23*4+),where each operand is a single digit and the operators are +,-,*, and /. The output of evaluate(expression) is the value of the expression (an integer).

 

Q11. Using the stack from Q (10), write a method/function called convert, which converts a postfix expression, passed as the first command-line argument to a fully-parenthesized infix expression. The expression will be of the form (23*4+),there each operand is a single digit and the operators are +,-,*, and /. The output of convert(expression) will be the infix representation (string).

 

 

Q12. Using the stack from Q (10), write a method/function called check, which checks if a sequence of parentheses, passed as the first command-line argument, is balanced. The expression will be of the form (()(())). The output of check (expression) will be 0/1 (integer) in C.

 

Q13.Write a C module that implements a circular queue using a doubly-linked list. Following functions need to be implemented:-

a).Add an item to the TAIL of the queue

b) Remove the head item from the queue

c).Return the current number of items in the queue

                                                       also check the condition about the overflow and underflow.

 

 


0 comments

Post a Comment

ad

Get Solution For your daily faced problems

Followers

About Us