Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

DATA STRUCTURES

Rating
-
Sold
-
Pages
7
Grade
A
Uploaded on
18-10-2023
Written in
2022/2023

Exam of 7 pages for the course internal tests at internal tests (DATA STRUCTURES)

Institution
Course

Content preview

Data Structures Using C

Module 1
1. Demonstrate the address calculation sort for the following no’s: 23, 54, 43, 25, 02, 26,
31, 15, 03, 08, 31, 21.
2. Demonstrate the radix sort for the following no’s: 300, 701, 17, 18, 140, 53, 55, 74, 82,
80, 100.
3. Differentiate between malloc and calloc.
4. Differentiate between Structure, Self-referential structures and Unions.
5. Illustrate the Knuth-Morris-Pratt Algorithm for the given text and pattern using LPS
table.
Text: ABC ABCDAB ABCDABCABDE
Pattern: ABCAB
6. Use the given two-dimensional matrix having m rows and n columns. Represent and
describe the two- dimensional matrix as sparse matrix using arrays.




7. Demonstrate multidimensional array with the help of C code.
8. Write a C program to demonstrate the memory leaks when pointers are not used
properly.
9. Write a C program to swap two numbers using the pointers concept.
10. Write a C program to demonstrate the operations on strings – by writing user-defined
string functions.
11. Explain the dynamic memory management with necessary methods.
12. Outline insertion sort? Explain the procedure for insertion sort. Sort
20,35,40,100,3,10,15 using insertion.


Module 2:
1. Define the concept of Stack and List out the different operations
performed on Stack.
2. Discuss the key difference between Stack and Queue with the help of case study.
3. With the help of C Code, Demonstrate the implementation of Stack using array and
Linked List.

, 4. What do you understand about the terms “Polish notation” and “Postfix Expression” ?
5. Convert the following expression :
● (A + B) * C – (D – E) ^ (F + G) to equivalent postfix notation.
● Convert the infix expression to prefix : ((A + B) * C – (D – E)).
● What is the result of evaluating the postfix expression AB-CD*/ given A= 2 , B = 10 ,
C=4 , D=1.
● Convert the infix expression (A + B) * (D + E + F)/(D*A) to prefix notation.Also
demonstrate with the help of stack contents.
6. What do you understand by the term “Recursion”? Demonstrate the concept of
recursive function in short with the help of
● Factorial
● Fibonacci Series
● Tower of Hanoi
7. With the help of C Code, Demonstrate the concept of representation of a queue with
the help of array and linked list.
8. Differentiate between Circular queue and Priority Queue. List the application of these
mentioned queue concepts.
9. Show the stack after each operation of the following sequence that starts with the
push(5), push(3), pop(), push(2), push(8), pop(), pop(), push(9), push(1), pop(),
push(7), push(6), pop(), pop(), push(4), pop(), pop().
10. In the Towers of Hanoi puzzle, we are given a platform with three pegs, a, b and c.
One peg, a, has a stack of n disks, each larger than the next, so that the smallest is on
the top and the largest is on the bottom. The puzzle is to move all the disks from
peg a to peg c, moving one disk at a time, so that we never place a larger disk on top
of a smaller one. Describe a recursive algorithm for solving the Towers of Hanoi
problem for arbitrary n.




Module 3:


1. What is a SLL? Write a program to implement stack as a singly linked list.
2. Write a program to find for a particular node (based either on the position or on info
of the node ) in a SLL.

Written for

Course

Document information

Uploaded on
October 18, 2023
Number of pages
7
Written in
2022/2023
Type
Exam (elaborations)
Contains
Only questions

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
antonitotheophor

Get to know the seller

Seller avatar
antonitotheophor Harvard University
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
193
Last sold
-
testbnks

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions