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

  Conduct a comprehensive scientific research

Conduct a comprehensive scientific research and write a scientific report (about 4000-5000 words) on the research.

  Compare network-based and host-based ids use in enterprise

Compare and contrast network-based and host-based IDS use in an enterprise. Determine the feasibility and necessity of utilizing one of these IDS implementations over the others.

  Create algorithm to accept current salary

Create the algorithm which will prompt for and accept current salary for each of faculty members, then compute and show their individual pay increases.

  Factors-principles considering indecency regulation issues

What factors and principles should the federal government take into account when considering indecency regulation issues?

  COSC122 Introduction To Computer Science Assignment

COSC122 Introduction To Computer Science Assignment Help and Solution, University of Canterbury - Assessment Writing Service

  Write schedule produced by earliest deadline first algorithm

Given below are two sets of real-time, periodic tasks. For (a), will the schedule produced by Earliest Deadline First algorithm meet all the deadlines?

  Decryption speed and diffie-hellman

Increase of a single bit in the size of the encryption key doubles the amount of needed computations - Show how the recipient of the message, who knows e, produces the plaintext.

  Market segmentation - cluster analysis

Review theoretical background based on available resources in the course content and Select a dataset from the module's recommended datasets

  Determine the branching factor

Expalin the search algorithm that results from each of the following special cases. How does it relate to other algorithms we have discussed.

  Recurrence for the running time of strassens algorithm

Write the recurrence for the running time of Strassens algorithm and Implement a divide and conquer algorithm for the problem

  Declare a global array solution

Declare a global array Solution

  Write a program that will perform the same operations twice

Write a program that will perform the same operations twice, once using an array of structs, and once using a pair of parallel arrays. The data will represent people's names and ages, so the first data structure will be an array of structs.

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