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

An archery target consists of a central circle of yellow

An archery target consists of a central circle of yellow surrounded by concentric rings of red, blue, black and white. Each ring has the same "width," which is the same as the radius of the yellow circle. Write a program ...

1 implement the addtosortedlist function for use with the

1. Implement the addToSortedList() function for use with the linked list version of the insertion sort algorithm. 2. Create a linked list version of the indicated algorithm. (a) bubble sort (b) selection sort

1 explain why we have only one frame type in a wired lan

1. Explain why we have only one frame type in a wired LAN, but four frame types in a wireless LAN. 2. Do the MAC addresses used in an 802.3 (Wired Ethernet) and the MAC addresses used in an 802.11 (Wireless Ethernet) bel ...

1 using the resources available in your library find out

1. Using the resources available in your library, find out what laws your state has passed to prosecute computer crime. 2. Using a Web browser go to www.eff.org. What are the current top concerns of this organization?

Using notepad write a program using pseudocode to solve

Using Notepad++ , write a program using Pseudocode to solve the following problem. Use the modular approach to solving the problem. Determine the median selling price of all homes in a subdivision named Botany Bay sold d ...

Set sorting searching and hashingoverviewquestions 1b and

Set: Sorting, Searching and Hashing Overview: Questions 1(b) and 2(a) of this assignment require a C++ compiler. As usual, you must submit the actual source code files (ending in .cpp) so that I can compile and run your ...

Questionconsider the following case of decision-making on

Question. Consider the following case of decision-making on loan applications.  You are a bank executive with thousands of records on customers who were given loans.  Each record has many fields, such as amount of loan, ...

1 why do many organizations ban port scanning activities on

1. Why do many organizations ban port scanning activities on their internal networks? Why would ISPs ban outbound port scanning by their customers? 2. What is an open port? Why is it important to limit the number of open ...

1 why does the network-layer protocol need to provide

1. Why does the network-layer protocol need to provide packetizing service to the transport layer? Why can't the transport layer send out the segments without encapsulating them in datagrams? 2. Why is routing the respon ...

Objective -the purpose of this program is to generate

Objective - The purpose of this program is to generate random numbers, report total number created, how many were 15, 16, or 17 and report this information to the user. You are required to use array, pointer and customis ...

  • 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