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

1 what is due care why should an organization make sure to

1. What is due care? Why should an organization make sure to exercise due care in its usual course of operations? 2. How is due diligence different from due care? Why are both important?

Wvcc has decided to purchase a standalone firewall reread

WVCC has decided to purchase a standalone firewall. Reread the "Improved Performance and Security for the Edge of the Network" section of the chapter to understand WVCC's requirements for the firewall. Do some Internet r ...

1 implement the function treesizeroot which computes the

1. Implement the function treeSize(root), which computes the number of nodes in a binary tree. 2. Implement the function treeHeight(root), which computes the height of a binary tree. 3. Implement the computeOp(lvalue, op ...

1 how does technological obsolescence constitute a threat

1. How does technological obsolescence constitute a threat to information security? How can an organization protect against it? 2. Does the intellectual property owned by an organization usually have value? If so, how ca ...

Implement a queue as a linked linear list such that it only

Implement a queue as a linked linear list such that it only occupies an amount of space proportional to the current queue size

Let m and c be random variables that take values from the

Let M and C be random variables that take values from the set of possible plaintexts and the set of possible ciphertexts for some cryptosystem. Prove that the cryptosystem provides perfect secrecy if and only if p(M | C) ...

Design values and adjustment factors in the following

Design values and adjustment factors in the following problems are to be taken from the 1997 NDS. Assume wood will be used in dry-service conditions and at normal temperatures unless otherwise noted. a. Describe softwood ...

1 an opaque urn contains three diamonds four rubies and two

1. An opaque urn contains three diamonds, four rubies, and two pearls. Construct a flowchart that describes the following events: Take a gem from the urn. If it is a diamond, lay it aside. If it is not a diamond, return ...

1 some of the application programs can use the services of

1. Some of the application programs can use the services of two transport-layer protocols (UDP or TCP). When a packet arrives at the destination, how can the computer find which transport layer is involved? 2. A client r ...

Zonealarm is a pc-based firewall and idps tool visit the

ZoneAlarm is a PC-based firewall and IDPS tool. Visit the product manufacturer at www.zonelabs.com, and find the product specification for the IDPS features of ZoneAlarm. Which of the ZoneAlarm products offer these featu ...

  • 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

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