+1-415-315-9853

info@mywordsolution.com

Engineering

 Civil Engineering Chemical Engineering Electrical & Electronics Mechanical Engineering Computer Engineering Engineering Mathematics MATLAB Other Engineering Digital Electronics Biochemical & Biotechnology

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

Consider an option on a non-dividend paying stock whose

Consider an option on a non-dividend paying stock whose share price is sh 120. The exercise price is sh 130, risk free rate is 10% per annum, volatility is 20% per annum and the time to maturity is one year. Construct a ...

1 design a predictor that would achieve a perfect accuracy

1. Design a predictor that would achieve a perfect accuracy if this pattern is repeated forever. You predictor should be a sequential circuit with one output that provides a prediction (1 for taken, 0 for not taken) and ...

For this discussion use the pest and porter 5-forces model

For this discussion, use the PEST and Porter 5-Forces Model to respond to the following: Identify environmental and industry influences that should be a concern or present an opportunity to Ford Motor Company. Provide a ...

A food processing company makes meatloaf to be sold in the

A food processing company makes meatloaf to be sold in the frozen food section of supermarkets. Each week the recipe used changes based on the current cost of ingredients. Ingredients and current costs are as shown below ...

Program assignment -for this assignment we are expanding on

Program Assignment - For this assignment we are expanding on assignment 3.  Now that we have parsed input, we will execute the code. As a reminder, the language has the following rules: 1. An empty string is a semantic e ...

1 in chapter 8 we learned that a circuit-switched network

1. In Chapter 8, we learned that a circuit-switched network needs end-to-end addressing during the setup and teardown phases. Define end-to-end addressing in a telephone network when two parties communicate. 2. When we h ...

Databases and system architecture discussionsanswer all

Databases and System Architecture Discussions Answer all discusion topics Cables • Discuss different types of cables and the advantages/disadvantages of each type: o twisted pair o coaxial cable o fiber-optic. • Which on ...

Consider an ethernet segment with propagation delay between

Consider an Ethernet segment with propagation delay between any two nodes at most 225 bit times. Assuming the smallest possible Ethernet frame to be 576 bits (which it is), can a host transmit a frame without detecting a ...

Assume that we have an isolated as running rip we can say

Assume that we have an isolated AS running RIP. We can say that we have at least two different kinds of datagram traffic in this AS. The first kind carries the messages exchanged between hosts; the second carries message ...

1 show that the approximate diffusion equations derived for

1. Show that the approximate diffusion equations derived for a constant electric field, (750.3A) and (750.4A), are also valid if E is not spatially constant but the region is quasi-neutral. This enables a derivation of a ...

• 13,132 Experts

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.

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

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