Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

PCA2 (40 Marks) Code 30 Marks Viva 10 Marks

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

PCA2 (40 marks)

Code = 30 marks
Viva = 10 marks

1> Write the code for a program that makes a doubly linked list with 9 random numbers
between 10 and 99, print it and then go to the 5th node. Write the code to do a random
traversal i.e. generate -1 or +1 randomly and if it is -1 go 1 place left else for +1 go 1
place right. Stop printing the sequence once any end is reached.

2> Write the code to generate a 20 node binary search tree with randomly generated
sequence containing numbers between 10 and 99. Print the inorder and pre order
traversal, along with the height of the tree thus generated.

3> Write the code for inserting into an AVL tree with 20 nodes with random numbers
from 10 to 99. After each insertion, print the inorder traversal and the height of the
tree, also print the rotation case selected.

4> Generate a random tree with 20 nodes with numbers from 10 to 99. Random tree:
in every insertion you can insert the newly formed node to either the left or right
subtree, chosen randomly.
Now check whether the random tree is a BST or not, print the inorder traversal also.

5> Make a random array of size 20 with random numbers ranging from 10 to 99. Then
use tree sort to sort the array. Print both the raw and sorted array.

6> Take an expression from the user (containing (,),0-9,*,+,-,/ and evaluate the
expression.

7> Take n from the user and then ask for n names iteratively. After each entry insert
them into a BST so that they are alphabetically sorted. After the n names are entered
do an inorder traversal with each node printed in a line.

Question mapping

2113059248 Fatima Ejaz 3


2113059253 Kaushik De 5
2113059255 Satyam Shukla 4
2113059256 Asutosh Kumar Jha 3
2113059257 Somak Bose 3
2113059258 Aman Singh 6
13000320019 Ritam Konar 1
13000320056 Sritama Ghosh Hazra 3
13000720046 Harsh Kumar 1
13001620080 Namrata Sanyal 7
13030820002 Jit Karan 3
13030820003 Ankush kumar 7
13030820004 Siddhartha Aryan 6
13030820005 Mouri Roy 1
13030820006 Saptarshi Dutta 4
13030820007 Ayush Taparia 6
13030820008 Kunal Kumar 4
13030820009 Debdipta Das 7
13030820010 Soham Bose 5
13030820012 Kingshuk Roy 5
13030820013 S. Shaayan Rooman 3
13030820014 Aman kumar Sah 2
13030820015 Sambuddha Koner 1
13030820016 Rohan Jha 7
13030820017 Arnab Mukhopadhyay 3
13030820019 Prabahan Singha Roy 6
13030820020 Vishal Choubey 6
13030820021 Pritam Chowdhury 3
13030820022 Sanskar Gupta 2
13030820023 Uttam Kumar 1
13030820024 Devyani 6
13030820025 Saurav Kumar Mahto 5
13030820026 Vivek Thakur 4
13030820027 Mudita Bhowmick 6
13030820028 Soumyadeep Majumder 2
13030820029 Shubhayu Majumdar 7
13030820030 Divya Kumar Baid 6
13030820031 Harsh Ranjan 1
13030820032 Sumedha Sarkar 3
13030820033 Avigyan Chakrabarti 1
13030820034 Debjoy Sarkar 6
13030820035 Oishik Mukhopadhyay 6
13030820036 Mahfuz Hossain Mallick 7
13030820037 Maitreyee Mitra 4
13030820038 Nilesh Sengupta 7
13030820039 Krishnendu Sengupta 3
13030820040 Sayan Kumar Ghosh 3
13030820041 Sarthak Sarkar 5
13030820042 Tilottama Biswas 5
13030820043 Swapnanil Chatterjee 2
13030820044 Shrishty Singh 7
13030820045 Samriddha Nag 5
13030820046 Ankan Biswas 7
13030820047 Shreyasi Karmakar 4
13030820048 Gargi Kar 3
13030820049 Satabdo Majumder 7
13030820050 Soumili Saha 1
13030820051 Sayantan Kuila 5
13030820052 Arnab Kumar Dutta 1
13030820053 Ananta Patnaikuni Pranay Kumar 2
13030820054 Abhinav kumar 5
13030820055 Adrija Guha 2
13030820056 Akhil Srivastava 6
13030820057 Aashirwad Wardhan 7
13030820058 Soham Sen 1
13030820059 Anurag Maitra 2
13030820060 Abir Mondal 3
13030820061 Dipen hore 6
13030820062 Sourav Chakraborty 3
13030820063 Ashish Kumar 6
Shriyoshi 7
Gaurab Pal 5
Kaushik De 4
Ganguly 6

You might also like