Write a complete program including a function

Assignment Help Data Structure & Algorithms
Reference no: EM132662132

Question 1. Write a function that will read one line of input from the terminal. The input is supposed to consists of two parts separated by a colon ‘ : '. As its result, your program should produce a single character as follows.

N: No colon on the line
L: The left part (before the colon) is longer than the right
R. The right part (after the colon) is longer than the left
D: The left and right parts have the same length but are different
S: The left and right parts are exactly same
Use a Queue to keep track of the left part of the line while reading the right part.

Question 2. Give the specification for each of these functions and implement them. Write a complete program to test these functions. I. ListEntry(L, P, T) - The entry (element) at the given position P is returned in T, and the list L remains unchanged.
II. AppendList(L2, L1, L) - Appends the list L2 to the end of the list L1 and returns the appended list L.
III. CopyList(L1,L2) - Returns list L2, which is the copy of the given list L1

Question 3. Consider a linked list to store a polynomial, that is, every node of the linked list has coefficient, exponent and pointer to the next node in the list.

Write a complete program including a function to add two polynomials. The function should accept pointers to the two polynomials as arguments and return the pointer to the resultant polynomial.

Assume that the polynomials passed to the function are in decreasing order on the exponents.
Example: 7x 80 + 5x 50 + 3x 30 + 1 = 0
9x 90 + 6x 60 + 2x 30 + 3 = 0

Reference no: EM132662132

Questions Cloud

Compare the physical assessment of child to that of an adult : Compare the physical assessment of a child to that of an adult. In addition to describing the similar/different aspects of the physical assessment.
What is the free cash flow to equity holder of macro : The depreciation is $250000. What is the free cash flow to equity holder of Macro?
Price of the stock-lakeshore company : LakeShore company is expected to generate sales of 7.5$ per share next year. However, due to extensive investments it is expected to have new earnings of -1.16$
Determine two variables for each of four categories : Determine two variables for each of the four categories.
Write a complete program including a function : Write a complete program including a function to add two polynomials. The function should accept pointers to the two polynomials as arguments and return
Calculate the economic life of piece of equipment : Sour Apricot Sherbet Shop, Calculate the economic life (years) of this piece of equipment. The first cost is $25,000 and MARR is 12%.
Compute the amount of consolidated net income : Compute the amount of consolidated net income and the income to be assigned to the noncontrolling shareholders of Gulfside and Paddock for 20x7
What statistics say in relation to abuse : Child abuse and maltreatment is not limited to a particular age-it can occur in the infant, toddler, preschool, and school-age years. Choose one of the four.
How do find the number of common shares outstanding : Find the number of common shares outstanding and the par value after the split. (Round par value answer to 2 decimal places.)

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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