Create a matrix based graph representation

Assignment Help Computer Engineering
Reference no: EM131013935

Detailed Question: Need a high score for those 4 labs and 1 assignment.

Lab1 Graph - Matrix
due April 3 at 23:59 (before Sunday)

Lab2
Graph - List
due April 10 at 23:59

Lab3 and lab 4
Linked Lists - Link Based Queue
and

Hashing - Hash Table

Assignment Program 4

Requirements : high quality and meets most professor's requirements for high score. The first lab should be done before April 3 . Prf you guys can finish the rest 3 labs and assignment as soon as possible with high quality and sent to me.

All information about 4 labs and 1 assignment included in a (doc,)document

Lab 1
Link Based Queue
Create a node class/struct.
Create a queue class/struct.

Members:
Node - a node that tracks the front of the queue.
Node - a node that tracks the end of the queue.
Count - indicates how many items are on the queue.

Methods:
En-queue
- Accepts a number and adds to the end of the queue.
De-queue
- Returns a number from the front of the queue.
- If the queueis empty, emit an error indicating the queueis empty.
IsEmpty
- Returns a boolean indicating if the queue is empty.

Lab 2
Graph Matrix
Create a matrix based graph representation.
It will need to support the following operations.
Ask the user how many points there are.
Ask the user to label those points, ie "A", "B", "C"...
Define the matrix as a square matrix based on the number of points, also keep an array of the labels.
Repeatedly ask the user to define edges between two points. Add these edges to the matrix.
Have a list method that will list out all of the edges in the graph.

Lab 3
Graph List
Create a list based graph representation.
It will need to support the following operations.
Ask the user how many points there are.
Ask the user to label those points, ie "A", "B", "C"...
Define the graph as an array of linked lists based on the number of points that holds labels. The node type would support the label and weight.
Repeatedly ask the user to define edges between two points with the weight of the edge. Add these edges to the list.
Have a list method that will list out all of the edges in the graph with their weights.

Lab 4
Hash Table
Create a hash table class/struct.
Define an array that holds 27 elements.
Define a function called Hash(int)
-This function returns the modulo of that int by the size of the table (array).
Define an add function that takes an integer.
-This function takes the integer, determines the hash of that number by calling the above hash function, then adds it to the table using linear probing for collision resolution.
Define a function that looks up a value, it takes an integer, return -1 if the value is not in the table.
Create a main that allows the user to add and lookup items in the table.

Lab submit rules
Submission Instructions
For labs, I only need source code to be attached. Click on the title of the lab to go to the submission page. Attach your source file(s) and submit, after submitting please click on your attachment to verify you can see your source code, if you can't neither can I, which means I'll have nothing to grade to give you points. Labs can be resubmitted as often as you want, however due dates still apply.

Assignment

Program Specification:

Build a hash table using chaining as the collision resolution technique. Insertions into the hash table will correspond to declarations of variables and values in a program, searches will be requests for the value of a variable. Some variables will be local and have a narrow scope while some variables will be global.

The program will take input from a file, another program written in the omnipotent programming language BORG (Bionicly Omnipotent Resistance Grinders) and generate output from this program.

The BORG language has the following commands (keywords):

1. START-FINISH blocks. Indicating different scopes.
2. COM - Single line comments: Text should be ignored if on the same line
3. VAR varName - Variable Declaration, adds "varName" to the hash table.
4. variable = expression - Assignment statements, ie GEORGE = 122. Find GEORGE in the hash table and assign 122 to it.
5. ++ - increment operator, syntax: VARIABLE ++
6. -- - decrement operator, syntax: VARIABLE --
7. expressions, expressions are limited to unary and binary arithmetic, or variable names
8. supported operators: + - / * % ^ (plus, minus, divide, multiple, modulo, exponent)
9. PRINT - syntax PRINT expression. If the expression is a variable, and this variable is not in scope, then an error message indicating unknown variable x at line number y. The value printed if there is a variable in scope should be the variable with the closest scope.
10. Errors - other than the print statements, our interpreter will not be responsible for detecting errors, syntax errors should be disregarded if encountered, assume that the source file is correct.

Our hash function: sum the ordinal values of the characters of the variable multiplied by their position in the string (1-indexing), then taking the modulo by TABLESIZE.

ie. The variable ABC = (65 * 1 + 66 * 2 + 67 * 3) % TABLESIZE

All tokens are separated by one space or a new line.

Output: for this assignment, run your interpreter on this sample source program as well as a program of your own, and turn it the output from both, as well as the source code from your BORG program as well as source code of the assignment and its executable. Zip is good.

X-Credit. Each student may implement one additional feature to the language, such as adding if, methods, more capable print statements. Only one student may implement a given extension to the language, and each extension must first be cleared with me.

Input Output

COM HERE IS OUR FIRST BORG PROGRAM

 

COM WHAT A ROBUST LANGUAGE IT IS

 

START

 

   VAR BORAMIR = 25

 

   VAR LEGOLAS = 101

 

   PRINT BORAMIR

BORAMIR IS 25

   BORAMIR ++

 

   PRINT LEGOLAS

LEGOLAS IS 101

   PRINT GANDALF

GANDALF IS UNDEFINED

   PRINT BORAMIR * 2

BOARAMIR * 2 IS 52

   COM

 

   COM NESTED BLOCK

 

   COM

 

   START

 

      VAR GANDALF = 49

 

      PRINT GANDALF

GANDALF IS 49

      PRINT BORAMIR

BORAMIR IS 26

   FINISH

 

   PRINT GANDALF

GANDALF IS UNDEFINED

   START

 

      LEGOLAS = 1000

 

      PRINT LEGOLAS

LEGOLAS IS 1000

   FINISH

 

   PRINT LEGOLAS

LEGOLAS IS 1000

   LEGOLAS --

 

   PRINT LEGOLAS

LEGOLAS IS 999

FINISH

 

Reference no: EM131013935

Questions Cloud

What energy photon would have this wavelength : Is it possible to have a scattering similar to Compton scattering from a proton in H2 gas? What would be the Compton wavelength for a proton? What energy photon would have this wavelength?
What is the peak wavelength of the emitted radiation : A typical person can detect light with a minimum intensity of 4.0 X 10-11 W/m2. For light of this intensity and A = 550 nm, how many photons enter the eye each second if the pupil is open wide with a diameter of 9.0 mm?
Compute the mean and median for a random variable : Compute the mean and median for a random variable with the probability density function shown below. f(x) = (1/1944) x2 over [0,18].
Describe peter''s professional background and experience : Describe Peter's professional background and experience, and how he came to Vigor Skin Care. What was his goal when he accepted his leadership role at Vigor? Did Peter have a strategy to turn around the product line sales to be more successful
Create a matrix based graph representation : Create a matrix based graph representation - Accepts a number and adds to the end of the queue and Create a matrix based graph representation.
Find equations for the level curves : Let s(x, y) = √(y2 - x2). Sketch the domain of s. Find equations for the level curves {(x, y) : s(x, y) = c} for c = 1, 2, 3, sod sketch the curves.
Compute the line integrals : Compute the line integrals ∫c_1 F · dr and ∫c_2 F · dr, where c1 (t) = (t, t2) and c2(t) = (t, t) for 0 ≤ t ≤ 1. Can you decide from your answers whether or not F is a gradient vector field? Why or why not?
Organize the following divisions of the nervous system : Analyze the basic functions and components of the autonomic nervous system (sympathetic and parasympathetic) nervous systems.
Find the speed of the star revolving around the system : Assume that Earth is in the planet's orbital plane, so that at one point in its orbit the star is moving directly toward Earth, and at the opposite point it moves directly away from Earth. How much is 550-nm light redshifted and blueshifted at tho..

Reviews

Write a Review

Computer Engineering Questions & Answers

  List the two new or changed features in ipv6

List two new or changed features in IPv6. define how each one affects Internet Protocol including the affects to inter-networking issues. Be thorough in your discussion.

  Questionour program has to take a string representing a

questionour program has to take a string representing a sentence in english and format it properly. the input sentence

  Write pseudocode using modularization

The Census Bureau has collected data about all of its employees. You will be given a data file which contains the GS number ( rating) for each employee, one per input record. A number of 1000 signifies the end of the data file.

  Find out the differences between the two files

Append the last two lines of each file to the file known Mollett.out without cutting and pasting (Hint: tail command can do this)

  What is the name generally given to that internal connector

What is the name generally given to that internal connector and give a typical example of what might connect to it.

  Write a java application which finds the total

Write down a JAVA application that finds the total and average of odd numbers from 1 to 15. Your JAVA program must use a counted loop to accomplish this task.

  Modify the pseudocode and optimize

offer valid reasons why the pseudocode is now more efficient.

  The difference between roles and groups

The difference between roles and groups

  Computer instruction format

In the computer instruction format, the instruction length is 11 bits and size of an address field is 4 bits? Is it possible to have the 5 2-address instructions 45 1-address instructions 32 0-address instructions utilizing the format.

  Web-based sites offer file sharing equal to napster

Do a Web search for stories about Napster and its legal battles. Why has the Recording Industry Association of America (RIAA) filed its lawsuit? How is this different from making a VHS copy of a movie or TV show with your VCR.

  Find a maximum-size independent set in g

An independent set of a graph G=(V;E) is a subset V`C= V of vertices such that each edge in E is incident on at most one vertex in V`. The independent-set problem is to find a maximum-size independent set in G.

  Create a program which contains a function called sumn()

Create a program which Contains a function called sumN().

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd