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

What are the four levels of transactions defined in ibms

What are the four levels of transactions defined in IBM's DRDA? Compare and contrast these four levels. Give examples to illustrate your answer.

You must use either for or while to solve the following

You must use either for or while to solve the following problems. a. Iterate through a vector, A, using a for loop and create a new vector, B, containing logical values. The new vector should contain true for positive va ...

Look at the results of engineering analyses in journals or

Look at the results of engineering analyses in journals or textbooks. What are the independent and dependent variables? Can a dependent variable be the independent variable in another experiment, and vice versa?

Design an efficient method that performs effective natiive

Design an efficient method that performs effective natiive Bayesian classification over an infinite data stream (i.e., you can scan the data stream only once). If we wanted to discover the evolution of such classificatio ...

The transducers we designed in this chapter to evaluate

The transducers we designed in this chapter to evaluate postfix notation and to convert infix to postfix have a funny quirk: they can accept some bad input strings and process them as if they were proper. (i) For each ma ...

Laboratory exercises ii symmetric and asymmetric

Laboratory Exercises II: Symmetric and Asymmetric Cryptography Introduction In this set of exercises we will study the basics of symmetric (secret key) and asymmetric (public key) cryptography. For this purpose, we will ...

Developing your understanding of the role of companies in

Developing your understanding of the role of companies in society is critical to determining the responsibilities companies have. describe your view of the purpose of companies. In other words, why do we have companies? ...

Show that each computation cycle of a p-processor erew pram

Show that each computation cycle of a p-processor EREW PRAM can be simulated on a √p ×√p mesh in O(D√p) steps, where D is the maximum number of processors accessing memory locations stored at a given vertex of the mesh.

Using a document at your own school for example a class

Using a document at your own school (for example, a class schedule), determine the attributes present in the document. Using your knowledge of the policies at your school, determine the functional dependencies present in ...

For each of the schedules of transactions t1 t2 and t3

For each of the schedules of transactions T1, T2, and T3 below: do each of the following: i. Insert shared and exclusive locks, and insert unlock actions. Place a shared lock immediately in front of each read action that ...

  • 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