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

DSA Assignment

This document contains 10 questions related to data structures and algorithms. Question 1 asks to write a program to store names, ages, and salaries of 10 people in a linked list sorted by name. Question 2 asks to create linked lists from two given linked lists containing common and unique elements. Question 3 asks to convert an expression to postfix notation and evaluate it. Question 4 asks to write an exponential algorithm using stack and without stack. Question 5 asks about representing a queue with a circular linked list and functions for add and delete. Question 6 defines a circular queue and asks to print elements in reverse order. Question 7 asks to find the postorder traversal of a given binary tree. Question 8 asks to remove nodes from a binary search tree and draw

Uploaded by

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

DSA Assignment

This document contains 10 questions related to data structures and algorithms. Question 1 asks to write a program to store names, ages, and salaries of 10 people in a linked list sorted by name. Question 2 asks to create linked lists from two given linked lists containing common and unique elements. Question 3 asks to convert an expression to postfix notation and evaluate it. Question 4 asks to write an exponential algorithm using stack and without stack. Question 5 asks about representing a queue with a circular linked list and functions for add and delete. Question 6 defines a circular queue and asks to print elements in reverse order. Question 7 asks to find the postorder traversal of a given binary tree. Question 8 asks to remove nodes from a binary search tree and draw

Uploaded by

Zoya Anand
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Q.

1 Write a program that reads the Name, Age and Salary of 10 persons and maintains them
in linked list sorted by Name.
Q.2 There are two linked lists A and B containing the following data: -
A: 2, 5, 9, 14, 15, 7, 20, 17, 30
B: 14, 2, 9, 13, 37, 8, 7, 28
Write programs to create: -
(a) A linked list C that contains only those elements that are common in both A and B.
(b) A linked list D which contains elements from both A and B, ensuring that there are
no repetition of element.
Q.3 Convert the expression (a+b)/(c-d) into postfix expression and then evaluate it for a=10,
b=20, c=15, d=5. Display the stack status for each operation.
Q.4 Write non-recursive version of the exponential algorithm Power (real x, integer n) where n
is a positive number. (Using stack and without using stack)
Q.5 Can a queue be represented by a circular linked list with only pointer pointing to the tail of
the queue? Write ‘C’ function for “add”, and “delete” operation on such a queue.
Q.6 What is a circular queue? Write a C program to print the elements of the queue in reverse
order.
Q.7 A binary tree has a preorder traversal of CABDIHKMEFGJLNO and an inorder traversal of
AIDBKHMCFEJNLOG. What is its postorder traversal?
Q.8 Use the remove algorithm to remove a node from the binary search tree shown below.
Draw the resulting tree for each.
(a) Remove node 65 from the original tree.
(b) Remove node 16 from the original tree.
(c) Remove node 12 from the original tree.
(d) Remove node 42 from the original tree.

Q.9

Q.10 Write an algorithm for:


(a) Merge Sort
(b) Radix Sort

You might also like