0% found this document useful (0 votes)
10 views

DS _Assignment1

This document is an assignment for the Data Structures & Applications course at Impact College of Engineering & Applied Sciences, detailing various topics such as definitions and classifications of data structures, dynamic memory allocation, structures vs arrays, pattern matching algorithms, sparse matrices, stacks, queues, linked lists, recursion, polynomial addition, and string operations. Each topic includes specific tasks or questions that require explanations, examples, and implementations in C programming. The assignment covers fundamental concepts and practical applications in data structures.

Uploaded by

shwetha.csefac
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

DS _Assignment1

This document is an assignment for the Data Structures & Applications course at Impact College of Engineering & Applied Sciences, detailing various topics such as definitions and classifications of data structures, dynamic memory allocation, structures vs arrays, pattern matching algorithms, sparse matrices, stacks, queues, linked lists, recursion, polynomial addition, and string operations. Each topic includes specific tasks or questions that require explanations, examples, and implementations in C programming. The assignment covers fundamental concepts and practical applications in data structures.

Uploaded by

shwetha.csefac
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

IMPACT COLLEGE OF ENGINEERING & APPLIED SCIENCES

Kodigehalli Post, Bangalore – 560 092


Data Structures & Applications (BCS304)
Assignment 1

1.Define data structures. With a neat diagram, explain the classification of data structures with
examples. Also list & explain data structure operations.

2. Explain Dynamic memory allocation functions with examples.

3. What is structure? How is it different from array?


Explain different types of structure declaration with examples.

4. Give difference between Structure and Union with example.

5. What do you mean by pattern matching? Outline the Knuth Morris Pratt (KMP) algorithm and
illustrate it to find the occurrences of the following pattern.
P: ABCDABD
S: ABCABCDABABCDABCDABDE

6. What is Sparse Matrix? Write ADT of Sparse Matrix. Express the given Sparse Matrix as triplets
and find its transpose.

7.Define stack. Implement push, pop and display operations for stack using arrays.
.
8. Write a C function to convert infix to a postfix expression. Convert the given expression:

A $ B * C – D + E / F / (G + H)

9. Write a function to evaluate the postfix expression.


Illustrate the same for the given postfix expression:
ABC-D*+E$F+ and assume A=6, B=3, C=2, D=5, E=1 and F=7.

10. Give the disadvantage of ordinary queue and how it is solved in circular queue. Explain with
suitable example how you would implement insert, delete and display circular queue using array.

11. Write a program in C to implement a stack of integers using a singly linked list

12. What is a linked list? Explain the different types of linked list with diagram
13.

14 With the C function to explain how the elements are inserted and deleted
from a doubly linked list

15. Define Recursion. Explain types of recursion. Write recursive function for
(i) Factorial (ii) Tower of Hanoi

16. Write the C function to add two polynomials. Show the linked representation of the below two
polynomials and their addition using a circular singly linked list
P1: 5x3 + 4x2 +7x + 3
P2: 6x2 + 5
Output: add the above two polynomials and represent them using the linked list.

17. Write an algorithm to evaluate a postfix expression. Trace the algorithm for the following expression showin
stack contents 651-4*23^/+

18. Define pointers. List the advantages of pointers over arrays.

19. What are the differences between array and linked lists.

20. Write functions in C for the following operations without using built-in functions
i Compare two strings.
ii Concatenate two strings.
iii Reverse a string

You might also like