I need some ideas on this problem

This is a discussion on I need some ideas on this problem within the C++ Programming forums, part of the General Programming Boards category; Here is the problem: 3.11 Write a function to add two polynomials. Do not destroy the input. Use a linked ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    I need some ideas on this problem

    Here is the problem: 3.11 Write a function to add two polynomials. Do not destroy the input. Use a linked list implementation. If
    the polynomials have M and N terms, respertively, what is the time complexity of your program?

    Can anyone give me some insight on how to do this? How could you write this function? I am not looking for code but maybe a explanation of how the code would look like.

  2. #2
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    I suggest you ask your teacher for help.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    Well, to write the function itself, check the exponent of the current term in the polynomial and if they are equal, add the coefficients.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 09:38 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  3. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21