File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes insertion of data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "insertion of data" Watch "insertion of data" New topic

insertion of data

Timothy Leong
Ranch Hand

Joined: May 25, 2005
Posts: 55
hi guys,

I did the following coding.
can you help me to check if this is an insertion sort linked list?? the node are inserted in ascending order of name. thanks alot

Jeff Langr
Ranch Hand

Joined: May 14, 2003
Posts: 799
Unfortunately I can't tell what the bold portion is. You might want to clarify by sticking a comment in your code section.

You might try writing some tests to see if the code has the expected behavior. Either make a bunch of calls in a main method or look at JUnit.


Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
I suggest that you test this out yourself. Start by writing a driver class that has a main() method. Then you can write code that calls the method that you have shown here. Then write some additional code to assert that it has the behavior to expect. The simplest way to do so is to just print out the results to the screen and compare it manually with what you expect to happen. If you want to get more sophisticated, you can add code that compares the results with an expected value automatically and just prints out a pass or fail message.

If this isn't entirely clear, show us some more code for the class that contains the method that you have written. I can help you fill in the details from there.


Java API Documentation
The Java Tutorial
I agree. Here's the link:
subject: insertion of data
It's not a secret anymore!