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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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