Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

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

How do you make a module in ms acessattached is a database

How do you make a module in MS Acess Attached is a database with modules that were done for me I need directions , how and why these are built .I am trying to understand VBA and programing better. Attachment:- info262_rm ...

1 explain how dhcp can be used when the size of the block

1. Explain how DHCP can be used when the size of the block assigned to an organization is less than the number of hosts in the organization. 2. Compare NAT and DHCP. Both can solve the problem of a shortage of addresses ...

Cost and measurement analysisidentify two non-current

Cost and Measurement Analysis Identify two non-current assets and comment on how Yahoo values these two assets in the balance sheet. Does the Yahoo have other alternatives as to how they could value the two assets? Which ...

Compare and contrast traditional outsourcing with the

Compare and contrast traditional outsourcing with the Software as a Service. Under what conditions do you think a company should choose SaaS over traditional outsourcing? Explain your views and discuss them with your pee ...

Repeat prob 91-8 using the complex signalprob 91-8consider

Repeat Prob. 9.1-8 using the complex signal Prob. 9.1-8 Consider a complex signal composed of a dc term and two complex exponentials Plot each N-point DFT as a function of frequency fk = k/N. (a) Compute and plot the DFT ...

Can you please help me to write a cover letter applying for

Can you please help me to Write a Cover Letter applying for an IT position in Computer Programming.

Question 1acalculate the binary values of the following

Question 1 (a) Calculate the binary values of the following decimals. The integer part of the converted binary numbers has a bit length of 8 bits. (i) 11 (ii) -12 (iii) 3.141 (iv) -5.252 (b) Differentiate between the adv ...

Assignmentscenario the newest gaming computer costs 5000

Assignment Scenario: The newest gaming computer costs $5000 for a 31-inch screen, two 1TB hard drive, a metallic case, and a blazing fast processor. Ten years ago, your grandmother gave you $2500. The money has been in a ...

Enhancement of a low-contrast image take a 25cent coin scan

(Enhancement of a low-contrast image) Take a 25¢ coin; scan and digitize it to obtain a 512 x 512 image. a. Enhance it by a suitable contrast stretching transformation and compare it with histogram equalization. b. Perfo ...

1 why should salts be chosen at random2 does using

1. Why should salts be chosen at random? 2. Does using passwords with salts make attacking a specific account more difficult than using passwords without salts? Explain why or why not. 3. Show that a system using an EKE ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen