Data structures practical

Data structures practical are essential as algorithm thinking and building is essential for any programming student therefore everyone must practise some tests below are few statements ,try solving these and if you unable do check solutions later.

ASSIGNMENT-1

In Second year Computer Engineering class of M students, set A of students play cricket and set B of students play badminton. Write C/C++ program to find and displayi. Set of students who play either cricket or badminton or both ii. Set of students who play both cricket and badminton iii. Set of students who play only cricket iv. Set of students who play only badminton v. Number of students who play neither cricket nor badminton (Note- While realizing the set duplicate entries are to avoided)

ASSIGNMENT-2

Write C/C++ program to store marks scored for first test of subject ‘Data Structures and Algorithms’ for N students. Compute I. The average score of class ii. Highest score and lowest score of class iii. Marks scored by most of the students iv. list of students who were absent for the test

ASSIGNMENT-3

Department library has N books. Write C/C++ program to store the cost of books in array in ascending order. Books are to be arranged in descending order of their cost. Write function for a) Reverse the contents of array without using temporary array. b) Copy costs of books those with cost less than 500 in new array c) Delete the duplicate entries using temporary array d) Delete duplicate entries without using temporary array e) Count number of books with cost more than 500.

ASSIGNMENT-4

Write C/C++ program for storing matrix. Write functions for a) Check whether given matrix is upper triangular or not b) Compute summation of diagonal elements c) Compute transpose of matrix d) Add, subtract and multiply two matrices

ASSIGNMENT-5

Department of Computer Engineering has student’s club named ‘Pinnacle Club’. Students of Second, third and final year of department can be granted membership on request. Similarly one may cancel the membership of club. First node is reserved for president of club and last node is reserved for secretary of club. Write C++ program to maintain club member‘s information using singly linked list. Store student PRN and Name. Write functions to Faculty of Engineering Savitribai Phule Pune University, Pune Syllabus for Second Year of Computer Engineering #21/65 a) Add and delete the members as well as president or even secretary. b) Compute total number of members of club c) Display members d) Display list in reverse order using recursion e) Two linked lists exists for two divisions. Concatenate two lists.

ASSIGNMENT-6

Second year Computer Engineering class, set A of students like Vanilla Ice-cream and set B of students like butterscotch ice-cream. Write C/C++ program to store two sets using linked list. compute and displayi. Set of students who like either vanilla or butterscotch or both ii. Set of students who like both vanilla and butterscotch iii. Set of students who like only vanilla not butterscotch iv. Set of students who like only butterscotch not vanilla v. Number of students who like neither vanilla nor butterscotch

ASSIGNMENT-7

Implement C++ program for expression conversion as infix to postfix and its evaluation using stack based on given conditions i. Operands and operator, both must be single character. ii. Input Postfix expression must be in a desired format. iii. Only ‘+’, ‘-‘, ‘*’ and ‘/ ‘ operators are expected.& Implement C++ program for expression conversiona) infix to prefix, b)prefix to postfix, c) prefix to infix, d) postfix to infix and e) postfix to prefix.

ASSIGNMENT-8

Queues are frequently used in computer programming, and a typical example is the creation of a job queue by an operating system. If the operating system does not use priorities, then the jobs are processed in the order they enter the system. Write C++ program for simulating job queue. Write functions to add job and delete job from queue.

ASSIGNMENT-9

A double-ended queue(deque) is a linear list in which additions and deletions may be made at either end. Obtain a data representation mapping a deque into a one-dimensional array. Write C++ program to simulate deque with functions to add and delete elements from either end of the deque.