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

  Tradeoff between breath first search, depth-fisrt-search

tradeoff between Breath First search, Depth-Fisrt-Search.Directed Acyclic Graphs(DAGs), Topological sorting and Dijkstra.

  How can store configuration information on a motherboard

Why do you think the trend is to store configuration information on a motherboard in CMOS setup  than by using jumpers or switches.

  Define the spirit of the recursion theorem of a program

define the spirit of the recursion theorem of a program.

  Sums each component of the pairs

Write a version of sumPairs of Ex. 3.1.8 that sums each component of the pairs discretely, returning a pair consisting of the sum of the first components and the sum of the second components. So essentially [(3,1)(10,3)] would return (13,4).

  Cnsider that computers are becoming ubiquitous and have

business and cyberethics please respond to the followinga possible view is that business and ethics simply have nothing

  What do you mean by "file type"

What is "File Type" and what are some of the important information to know about it.

  Write down program for a bank account

Write down program for a bank account

  Develop an incident-response policy which covers the growth

gem infosys a small software company has decided to better secure its computer systems after a malware attack shut down

  What are the problems related with generalizing the results

question 1 what are the problems associated with generalizing the results from controlled tests on information systems

  Write a process findranks in java

Write down a method findRanks in Java that accepts an unsorted array of integers vals, and a starting and ending rank start and end, numbering ranks from 0, and returns an unsorted (any order is acceptable) array containing the lo-th through the h..

  How could usability be determined

Locate two Web sites that you feel exhibit exemplary design features. define why you selected each site. What design features stand out on each site? Are these features unique to the Web sites you selected or are they used by their competitors or s..

  Question1 use big-theta notation to classify traditional

question1. use big-theta notation to classify traditional grade school algorithms for addition and development. that is

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