Modify the LinkedList1 presented in this chapter by adding sort() and reverse()
ID: 3535548 • Letter: M
Question
Modify the LinkedList1 presented in this chapter by adding
sort() and reverse() methods.
The reverse method reverses the order of the elements in the
list,
and the sort method rearranges the elements in the list so
they
are
sorted in alphabetical order. Do not use recursion to
implement
either of these operations. Extend the graphical interface
in
the
LinkedList1Demo class to support sort and reverse commands,
and
use
it to test the new methods.
(linkedlist1 source code:)
(linked1 demo source code)
Explanation / Answer
A lot of folk can't or won't follow links. The reasons vary from corporate firewalls to the laziness that programmer's prize for its productivity. But one reason stands out: this is a "help" site and nobody can really help without knowing where you're coming from. So you might do better to make the problem specific (pick one, eg the reverse one might be easier), have a go, and post your code.
It really doesn't matter whether it wroks or not. But explain how you are going about the implementation, and what compiler messages or runtime exceptions etc you encounter.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.