1

I know this is a computer science problem, but I am about to blow a gasket over the meaning implied or inferred here.

Does this not refer to a single linkedlist that can be inferred from the adjectives used? It is not necessary to know what a linkedlist is in order to understand the meaning, I think.

Write a function called Maximum that determines the maximum value of the integers in the linked list. The function should also output the maximum value. Write a driver function to insert the following integers (15, 20, 30, 7, 8) into the linked list. Call the Maximum function from the main to determine the maximum integer in the linked list.

  • 1
    If you don't know what a linked list is you need to re-read a few chapters in your textbook. – Hot Licks Feb 6 '16 at 1:44
  • I'm voting to close this question as off-topic because this is a question about computer programming, not English. – Hot Licks Feb 6 '16 at 1:45
  • @HotLicks why? I am asking about what teh problem means, not about the programming component. Comments are just incidental. "In the linked list", "insert into the linked list". Also if it refers to the numbers specified. – Bob R Feb 7 '16 at 8:51
  • "Linked list" is a term in programming/computer science. Ask an English professor what it means and he will guess that it means a long list on multiple pages of paper, taped together. If necessary you can look up "link" (verb) and "list" (noun) in a dictionary. (You should do this sort of thing before you ever ask a question here.) – Hot Licks Feb 7 '16 at 13:49
1

Yes, this is referring to a single linked list.

The problem is saying that you will need to create/maintain in memory a single linkedlist. You need a function capable of inserting values into the list (which will involve changing to the pointer to the new items). You will then need to write a function that iterates over the list, item by item, finding the maximum. You then need to write a program with a main function that finds the maximum.

There is nothing in the problem that implies you should be using two linkedlists, or a doubly linkedlist.

The are thousands of examples on the web in many languages.

  • Yea, I know what it linkedlist is thankfully. I was deducted points from not taking into account negative numbers, or the linkedlist containing all negative numbers. I just wanted to check if I was insane :) – Bob R Feb 6 '16 at 0:56
  • 1
    I can't comment on the insanity, but it's not clear how negative numbers would matter... Unless you used an unsigned int or equivalent. – jimm101 Feb 6 '16 at 1:00
  • Since the text given clearly specifies "integers", but not "positive integers", in the absence of other clarifying guidelines I would also ding you for a solution that fails on negative inputs. – Hellion Feb 6 '16 at 2:41
  • @Hellion. I agree. I just can't imagine how you could write code that would fail with negatives unless it was typecast wrong. Strange. – jimm101 Feb 6 '16 at 2:49
  • @jimm101 - Since his function is supposed to find the "maximum", it's possible that that function was somehow mucked up such that it, eg, took the absolute value of the numbers being tested. – Hot Licks Feb 6 '16 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.