Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6528975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:35:08+00:00 2026-05-25T09:35:08+00:00

I was reading about linked list implementation of polynomials. It stated, Compare this representation

  • 0

I was reading about linked list implementation of polynomials. It stated,

Compare this representation with storing the same
polynomial using an array structure.
In the array we have to have keep a slot for each exponent
of x, thus if we have a polynomial of order 50 but containing
just 6 terms, then a large number of entries will be zero in
the array.

I was wondering how do we represent a polynomial in an array? Please guide me.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:35:08+00:00Added an answer on May 25, 2026 at 9:35 am

    A complete Java implementation of array-based polynomials is here: https://cs.lmu.edu/~ray/classes/dsa/assignment/2/answers/

    The basic idea is that if you have a polynomial like

    4x^6-2x+5
    

    then your array would look like

       0     1    2    3    4    5    6
    +----+-----+----+----+----+----+----+
    | 5  |  -2 |  0 |  0 |  0 |  0 |  4 |
    +----+-----+----+----+----+----+----+
    

    That is

    • the coefficient 5 is in slot 0 of the array (representing 5x^0)
    • the coefficient -2 is in slot 1 of the array (representing -2x^1)
    • the coefficient 4 is in slot 6 of the array (representing 4x^6)

    You can probably see how this represenation would be wasteful for polynomials like

    3x^5000 + 2
    

    In cases like this you want instead to use a sparse array representation. The simplest approach would be to use a map (dictionary) whose keys are the exponoents and whose values are the coefficients.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading about linked lists and their implementation in C on Wikipedia . I
I'm reading a textbook and it's talking about hash-list implementation. With regard to the
Reading about the G.729 codec , I found this interesting tidbit about Comfort Noise
Reading about Kohana templates and saw something I've never seen before: $this->template->title = __('Welcome
Reading about Django, I saw this: http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#ref-contrib-admin - the fancy simple to use admin
I've been reading about foreach and list iteration, and I understand how to set
I was reading this question , I wanted to ask more about the code
I've been reading about OOP in C but I never liked how you can't
I'm reading about Red Gate SQL Backup, and I liked the concept of creating
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.