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

Select a java program that contains an exception error the

Select a Java program that contains an exception error. The exception error can be one that you have encountered yourself or one you located using the Internet. Describe your chosen exception error and explain potential ...

The farmworker movement documentation project founded in

The Farmworker Movement Documentation Project, founded in 2003 by LeRoy Chatfield, is a labor of love. The project seeks to compile and publish primary source accounts from the volunteers who worked with Cesar Chavez to ...

1 describe a physical firewall that is used in buildings

1. Describe a physical firewall that is used in buildings. List the reasons why an organization might need firewalls for physical security controls. 2. What is considered the most serious threat within the realm of physi ...

Design a help-desk priority manager store help requests

Design a help-desk priority manager. Store help requests stored in a text file with the following structure: priority, id of requesting party, time of request The priority is an integer in the range 1-5 with 1 being the ...

Answer all 9 questionsshort answer 1-810 points each with

Answer All 9 questions Short Answer 1-8[10 points each with each about 3/4 - 1 page double-spaced]: 1. If the spot rate for Swiss Francs versus US Dollars is one SF equals 1.05 US$, and the annual interest rate on fixed ...

In the fourth lab we investigate smtp protocol in action we

In the fourth lab, we investigate SMTP protocol in action. We send an e-mail and, using Wireshark, we investigate the contents and the format of the SMTP packet exchanged between the client and the server. We check that ...

Innbsp300 words answer the following discussion post

In 300 words, answer the following discussion post question: The Green Organization is a conglomerate of many smaller business units. The organization has offices globally. Some offices are contracted independent agents ...

Since may 26 2002 the aes advanced encryption standard

Since May 26, 2002, the AES (Advanced Encryption Standard) describes the official standard of the US government. 1. The evolutionary history of AES differs from that of DES. Briefly describe the differences of the AES hi ...

Design and implement an algorithm that will efficiently

Design and implement an algorithm that will efficiently search a given text for a particular keyword or pattern and record the number of times the keyword or pattern is found. Design a main program that calls the procedu ...

Assume alice the client creates a tcp connection with bob

Assume Alice, the client, creates a TCP connection with Bob, the server. They exchange data and close the connection. Now Alice starts a new connection with Bob by sending a new SYN segment. The server responds with the ...

  • 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