Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

program using linked lists and recurison

Thread view: 
rain2222 - 17 Nov 2005 21:16 GMT
ok so i am completely new to java and i don't even know where to
begin.....any help would be greatly appreciated!!

Given a sequence of numbers, write a class named my_Special_Order to store
them in a linked list and then print them on the screen by starting from
the middle, printing each number going left until beginning is reached,
then starting from the middle and then printing each number (excluding the
middle) going right until end is reached. For example, given “103 23 4 13
21 18 19” as input, your program should print out “13 4 23 103 21 18 19”.
Hint: Using the LinkedList Class, the new class should contain at least
two methods: one for setting the sequence and pointers to beginning,
middle and end, and one for printing the interior of the sequence in the
required order.
2. (50 points) Write a java class named my_Reverse using recursion. It
takes a string of letters or digits of length at most 100 and prints it in
reverse order. For example, given “welcome 2005” as input, your program
should print out “5002 emoclew”. Note that space is the only separator
between words.
Sample Run:
Problem 1:
Enter numbers:
1 2 3 4 53
The desired sequence:
3 2 1 4 53
Problem 2:
Enter string:
welcome 2005
Reverse string:
5002 emoclew
Monique Y. Mudama - 17 Nov 2005 21:21 GMT
> ok so i am completely new to java and i don't even know where to
> begin.....any help would be greatly appreciated!!

Have you tried talking to your instructor about it?

> Given a sequence of numbers, write a class named my_Special_Order to store
> them in a linked list and then print them on the screen by starting from
[quoted text clipped - 22 lines]
> Reverse string:
> 5002 emoclew

Signature

monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html

Roedy Green - 17 Nov 2005 22:19 GMT
>Given a sequence of numbers, write a class named my_Special_Order

see http://mindprod.com/jgloss/homework.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.