Ask Question, Ask an Expert


Ask Computer Engineering Expert

problem 1) This assignment deals with creating multi-linked list data structure for storing and processing student's academic data. To keep problem simple, this program would deal with only rollnumbers. The type of roll-numbers we deal with are also restricted as described below.
A roll-no comprises of an 8-digit integer. The first 2 digits indicate the year of joining ( E.g. 1998 would be coded as 98, ignore the y2K problem ). The 3rd , 4th and 5th digits indicate the department where the program is offered. Sample values are given below. 108 : IT 109 : Electronics 104 : Civil 107 : Computer 105 : Elec 102 : Mech 6th digit indicates male or female student. Male=0 and female=1.

7th digit is for category for admission. The last 2 digits denote the serial number of the student. It should be clear from above that given a roll number of a student, one can find out certain details about the student.

(a) A list of roll-numbers would be given to you in a file ( say file, "input"); how many such numbers are there are not known apriori. You have to process the roll-numbers and create a multi-linked data structure as describeed below:

A node of this structure has 3 fields : i) rollno ii) a link field, say dept_link and iii) another link field, say prog_link. The dept_link links this node to another node that has the same dept code ( 4th and 5th digits ). Similarly the prog_link links this node to another node that has the same program code ( 3rd digit ). The last node in the chain for a department or program would have a NULL value respectively.

This multi-linked structure would be accessed using 2 arrays, dept array and prog array. Each element of these arrays is of type pointer to node. Note that every rollno exists on two lists, one linked via the dept code and the other linked via the program code. For the following roll-numbers, the data structure to be constructed is shown on a separate page. Input : 041051122

(b) Given a dept code, your program should list all roll nos belonging to that department. Similarly given a program code, your program should list all students registered for the program.

problem 2) Given a list of integers, construct a binary search tree from the list. You may use any algorithm for constructing the tree. Use a linked list representation for the tree where each node has two pointers, one for the left subtree and the other for the right subtree and an integer field. The binary tree is to be accessed by a pointer to the root of the tree.

a. Use a header file say "btree.h" to place the class definition of a binary tree. Incorporate appropriate function and data members for using a binary tree. A separate main() is to be used for solving the programming problem.

b. After constructing the search tree, read in a few values (some which exist in the tree and some which don't ) and search the tree for these values. In case of the value being found, output a string of the form, LLRLR. This string would indicate the path followed from root in the tree leading to the value. For ex, the string LRLL for a value say 20 would indicate that 20 was found by proceeding from the root as follows:

Left (L); Right(R); Left(L); Left(L). Note that such string is a unique signature for any element present in the tree.

c) prepare down three non-member functions for inorder, preorder and postorder traversals of binary search tree. For the tree constructed in part(b)above, demonstrate the result of all the three traversals.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M96641

Have any Question? 

Related Questions in Computer Engineering

Brt has an income of 133 and a utility function ux1 x2

Bart has an income of $133 and a utility function U(x1, x2) = 28x1/21+ x2. The price of good 1 is $2 and the price of good 2 is $1. How many units of good 1 and good 2 will Bart demand? As his income keeps increasing, ho ...

Assume you are hired to manage a very large it project such

Assume you are hired to manage a VERY large IT project such as the initial creation of Write a paragraph describing the project and then provide a list of the stakeholders for the project and describe their r ...

Data structures and algorithmsobjectivesdesign and

Data Structures and Algorithms Objectives Design and implement a program based on a greedy algorithm to solve the Minimal Spanning Tree (MST) problem; Choose and implement appropriate data structures for the algorithm; A ...

What buckets are used in fig 2313 to answer queries of the

What buckets are used in Fig. 23.13 to answer queries of the form "how many l's in the most recent k bits?" if k is (a) 10 (b) 15 (c) 20? What are the estimates for each of these queries? How close are the estimates?

The bfr algorithm represents clusters by summary statistics

The BFR Algorithm represents clusters by summary statistics, as described in Section 22.5.5. Suppose the current members of a cluster are {(1,2), (3,4), (2,1), (0,5)}. What are the summary statistics for this cluster?

What is an intranetafter a dbms has been selected what is

What is an intranet? After a DBMS has been selected, what is the DBA's role in DBMS maintenance? What are the DBA's responsibilities with regard to the data dictionary? Who trains computer users in an organization? What ...

M repeat part a only of problem a33 for a machine that is

[M] Repeat part (a) only of Problem A.33 for a machine that is to recognize the occurrence of either of the subsequences 011 and 010 in the input sequence, including the cases where overlap occurs. For example, the input ...


Audacity/Podcastin  Audacity- Podcast Project Record at least a 1-2 minutes of audio. You can record yourself or someone else such as a short interview. Topic:Keep it educational or possibly ...

I dredged reclamation what are the considerations

In dredged reclamation, what are the considerations in selecting between trailer suction hopper dredgers and grab dredgers?

Adam smith argued that at birth most people were similarly

Adam Smith argued that at birth most people were similarly talented, and that differences in individual abilities, and hence productivity, are largely the effect of the division of labor, not its cause. What implications ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate