Applet as driver for linked list

i have a class called carlist that has these methodes:
public void Delete(String DelElement)
public void InsertEnd(String NewElement, int NewNumElement )
public int GetAmount(String target)
public void UpdateAmount(String name, int number)
my node class is:
ListNode(String NewElement, int NewNumElement, ListNode Node)
Element = NewElement;
NumElement = NewNumElement;
Next = Node;
and the inner class that prints the list:
public class CarListIterator {
ListNode CurrentNode;
CarListIterator(CarList List){
CurrentNode = List.Head; } String Next() throws ListException{
String str = CurrentNode.Element + " " + CurrentNode.NumElement;
if (!End())
CurrentNode = CurrentNode.Next;
if (!End())
return str;
else
throw new ListException("Attempt to access beyond end list.");}
boolean End(){
return CurrentNode == null;}}
the problem is that i need a driver as an applet to test the class
cann any one show me how to call one of the methods above, so i can do the rest.

I tryed but i do not know lot about applet. please help!

Similar Messages

  • N^2 log(n) for Collections.sort() on a linked list in place?

    So, I was looking over the Java API regarding Collections.sort() on linked lists, and it says it dumps linked lists into an array so that it can call merge sort. Because, otherwise, sorting a linked list in place would lead to a complexity of O(n^2 log n) ... can someone explain how this happens?

    corlettk wrote:
    uj,
    ... there are other sorting methods for linked lists with an O(N*N) complexity.Please, what are those algorithms? I'm guesing they're variants off insertion sort, coz an insertion is O(1) in a linked list [and expensive in array]... Am I warm?You don't have to change the structure of a linked list to sort it. You can use an ordinary Bubblesort. (The list is repeatedly scanned. In each scan adjacent elements are compared and if they're in wrong order they're swapped. When one scan of the list passes without any swaps the list is sorted). This is an O(N*N) algoritm.
    What I mean is it's possible to sort a list with O(N*N) complexity. It doesn't have to be O(N*N*logN) as the Java documentation kind of suggests. In fact I wouldn't be surprised if there were special O(N*logN) algoritms available also for lists but I don't know really. In any case Java uses none of them.

  • Bubble Sort in Linked List

    so, everything works through the first iteration (don't know if this is an appropriate term for linked lists, but we just learned arrays) but then it stops. I thought that telling it to continue until position.next != null and increasing the position after every iteration would work but I think I have coded something incorrectly / am not taking something into consideration. I would be greatly obliged if you can offer any advice!
    Thanks,
    Hunter
           public void bubbleSort()
             Node current, a, previous, position;
             position = new Node(0);
             position.next = head;
             head = position;
             while (position.next != null)
             {  current = position.next;
                        previous = position;
                a = current.next;
                while(a != null)
                   if (a.getVal() < current.getVal())
                      Node temp = a.next;
                      a.next = previous.next;
                      previous.next = current.next;
                      current.next = temp;
                                  previous = a;
                                  a = temp;
                    else
                                  a = a.next;
                      current = current.next;
                                  previous = previous.next;
                 position = position.next;
             head = head.next;

    First, thanks for the response! I have been trying println statements and really don't understand the problem. I have also gone through line-by-line and drawn out what I think is supposed to happen and still can't seem to fully figure out what I am doing wrong. Here is the full code, this might help with the 'definition of my list'.
        public class LinkedList
          public Node head;
           public LinkedList(int length)
             head = null;
             for (int i = 0; i < length; i ++)
                insert(i);
           public LinkedList()
             head = null;
           public void clear()
             head = null;
           public void insert(int n)
             Node current = new Node(n);
             current.next = head;
             head = current;
           public void insert(Node n, int index)
             Node previous, current;
             Node nnode = new Node(-10);
             nnode.next = head;
             previous = nnode;
             current = head;
             while (current != null && index > 0)
                current = current.next;
                previous = previous.next;
                index --;
             if (previous == nnode)
                n.next = head;
                head = n;
             else
                previous.next = n;
                n.next = current;
       //Delete the node at the zero-based index.
           public void delete(int index)
             int current;
             Node currentnode = head;
             for (current = index; current > 1; current --)
                currentnode = currentnode.next;
             if (currentnode == head)
                head = head.next;
             else
                currentnode.next = currentnode.next.next;
           public Node getNode(int index)
             Node nnode = new Node(-10);
             nnode.next = head;
             Node current = head;
             while(current.next != null && index > 0)
             {     current = current.next;
                index --;
             return current;
           public int getVal(int index)
             int current;
             Node currentnode = head;
             for (current = index; current > 0; current --)
                currentnode = currentnode.next;
          //currentnode should point to the node whose value we want.
             return currentnode.getVal();
           public void print()
             System.out.println();
             head.print();
           private void swap(Node pa, Node a, Node pb, Node b)
             Node temp = b.next;
             pa.next = b;
             if (a.next != b)
                b.next = a.next;
                pb.next = a;
             else
                b.next = a;
             a.next = temp;
           public void selectionSort()
             Node current, a, previous, position;
             position = new Node(0);
             position.next = head;
             head = position;
             while (position.next  != null)
                current = previous = position.next;
                a = position.next;
                while(a != null)
                   if (a.getVal() < current.getVal())
                      current = a;
                      while(previous.next != current)
                         previous = previous.next;
                   a = a.next;
                if (current != previous)
                   Node t = position.next;
                   swap(position, t, previous, current);
             //System.out.println("****************");
             //head.print();
                position = position.next;
             head = head.next; //to lose the initial node.
          //System.out.println("end of sorting, head.print is");
          //head.print();
           public void bubbleSort()
             Node current, a, previous, position;
             position = new Node(0);
             position.next = head;
             head = position;
             while (position.next != null)
             {  current = position.next;
              previous = position;
                a = current.next;
                while(a != null)
                   if (a.getVal() < current.getVal())
                      Node temp = a.next;
                      a.next = previous.next;
                      previous.next = current.next;
                      current.next = temp;
         previous = a;
         a = temp;
                    else
                    a = a.next;
                    current = current.next;
         previous = previous.next;
                 position = position.next;
             head = head.next;
          }

  • HP Officejet 4255 driver for Windows 7, 32 bit. Not in pull up list or OS(can't update)

    HP Officejet 4255 driver for Windows 7, 32 bit.
    Driver is not in pull up list and not in OS(can't update OS basic). Almost all series are listed but 4200 series is missing. 
    After upgrade to Windows 7, it has become a problem. Some solution should be given.
    Can someone help?
    Regards,
    Raul

    Ok, I found in the Net the drive 7uw706ww.zip, which is Version 6.1.4.2, while the updated version is 6.1.10.5 (7UW708WW).
    I tried again the GPS, and it wasn't working.
    Anyway, before downgrading, I tried to reinstall the new driver, downloading and installing the .exe instead going through System Update.
    Result: now GPS is working (same place, same conditions, just 5 minutes later)!
    Don't know where the difference is...
    600, R52, T61p, X301

  • I have a new Mac Pro.  I want to use my old Mac Pro as a storage drive for photos and old documents, linked to my new Mac Pro.  How do I set up the old computer?

    I have a new Mac Pro.  I want to use my old Mac Pro as a storage drive for photos and old documents, linked to my new Mac Pro.  How do I set up the old computer?  Both computers have OS X10.9.3.  Currently they are connected by a Firewire 800 cable.

    You certainly could keep the old Mac Pro in Firewire mode (hold down the T key on its keyboard as you boot) to show its drives on the new MP. This is basically as fast as putting the drives into a Firewire enclosure.
    Or you could boot it normally and share its files over the network using the Sharing panel of System Preferences. If you turn on both File and Screen Sharing, you don't even need to have a monitor attached - you can do all administration using screen sharing. However, this method requires that you open all files over the network, which will be slower than the direct-connect method above, and may also not work with all applications.
    Matt

  • I would like to take a iTunes play list and put it on a USB drive for my car radio to stay in my car. Is there a way to do this through iTunes so you have all the song info and there's no number in front of the name of the song? Is there a program?

    I would like to take a iTunes play list and put it on a USB drive for my car radio to stay in my car. Is there a way to do this through iTunes so you have all the song info and there's no number in front of the name of the song? Is there a program?

    iTunes only syncs to Apple devices.
    Assuming the media is not DRM protected, any of the media can be dragged and dropped from iTunes onto other drives (external, flash, etc) as the user chooses.

  • HT1338 Why doesn't "Software Update" show me the new driver for the Epson 50C20D (Artisan 800) while It is on the list of available new driver?

    Since I upgraded to mountain lion, my Artisan printer stopped working. After talking to Epson and trying all kind of things, it was determined its definitely a driver problem. The PC ping the printer well but won;t print to it as it think its not connected (when it is as priven by the ping).
    The new driver for Epson 50C20D are on the list of update available drivers on the OS X wen site yet trigering "Software Update" does does detect I need it... Why is that? Thanks

    Thanks Mende1. The printer is there and installed allright. Even shows as "idle" until I try to print to it. The driver version shows 6.36 and I ned to update to 9 which is only avail from the App store... However, the app store don't detect I need it..

  • Turning a linked list into a for loop

    Im stupid and cannot figure out how to make this
    lp list1 = new lp(0,new lp(1, new lp(2, new lp(3, new lp(4, new lp(5, new lp(6, new lp(7, new lp(8, new lp(9, null))))))))));
    into a for loop, i know its simple, i finished my first linked list assignmenet but having this in my program is too ugly and i know a loop should fix it

    JosAH wrote:
    cotton.m wrote:
    Ip list = new IP(9,null);
    for(int i descending order starting from 8 and going down to zero)
    list = new Ip(i,list);
    That last/first element can be in the loop too:
    Ip list = null;
    for(int i descending order starting from 9 and going down to zero)
    list = new Ip(i,list);
    }kind regards,
    Josd'oh! Yes that's better. Thanks.

  • Need mac driver for TP-Link Wireless USB adapter TL-WN7200ND

    i need Mac driver for TP-Link Wireless USB adapter model no TL-WN7200ND

    First of all, TP-Link does not provide OS X drivers for that adapter. However, there are other sources that have drivers like this one. It is not official and it may fail, but it has been tested by other users and it works correctly.

  • Where Is The Archive (Link) For "The List" (Weekly Suggested Compilations)

    Each week (or so), the iTunes Store has a button link to the current song compilations for certain themes. For example, this week, it is 17 college fight songs. A few weeks ago, I wanted to check out the suggested downloads for popular TV commercial songs. However, the next day I logged onto the iTunes Store, a new listing had already been made, and I am having trouble finding (a link to) the archive for "The List" (if it actually exists, and if not, one should be made). Thanks.
      Windows XP  

    can you send a screen shot? I have my archive folder.

  • I upgraded to 10.9.2 and now my Canon MX870 won't print.  Their driver site only listed drivers for 10.6.  How do I make this work?

    I upgraded to 10.9.2 and now my Canon MX870 won't print.  Their driver site only listed drivers for 10.6.  How do I make this work?

    I just looked at the Canon site and it has Mavericks drivers.
    http://www.usa.canon.com/cusa/macosx_lion/multifunction_printers/pixma_mx_series /pixma_mx870?selectedName=DriversAndSoftware

  • IA07 : Key for Task List Group and Production resource tool number link

    HI abapers,
    In IA07 TCODE , i want to retrieve Key for Task List Group( PLNNR ) and Production resource tool  number ( FHMNR) .
    In technical settings for both the feilds, structure names are mentioned.
    Is there any function module or table link to retrieve both .
    thansk & regards
    Raghul

    Hi Raghul,
                    i am also facing the same issue. Kindly let me know if u get any solution for this.
    Thanks in advance.
    -AruN.

  • Creating a new WPC Content Layout for a Link List

    Hello all,
      As I've been lurking about the innards of Web Page Composer, I noticed that the Link List contains two different XSLTs for it representing different "Content Layouts".
      Has anyone added a new Content Layout for an item?  If so would they happen to have some high level steps on accomplishing it?  It doesn't appear to be as difficult as some of the other custom configurations in adding new content types and new forms. So far I suspect the steps are:
    Create the new XSLT and upload to KM.
    Go to System Admin/System Configuration/KM/CM/Editor/Stylesheets/Stylesheets and hook up the XSLT to the engine
    Go to System Admin/System Configuration/KM/CM/Editor/Stylesheets/Stylesheet Groups/Document Styles Groups and add the stylesheet to the lists group.
    Bounce the Portal
    That seems to be it, but it would shock me if it was all that was required.
    Any thoughts?

    So I answered my own question.
    It is as simple as I listed above. To create a new list rendering:
    Simply create the new XSLT and stick it under /etc/wpceditor/styles
    Then create the StyleSheet reference under: System Admin/System Configuration/KM/CM/Editor/Stylesheets/Stylesheets.
    Then add the StyleSheet reference to the "lists" group.
    Bounce the portal.
    You'll have a new option when you select the style.

  • Organizing entries in link list shall not be possible for standard users

    Hello,
    how can I avoid that a standard user can organize the entries in the iView <i>Links List</i>?
    That means the link 'Organize Entries' shall not be shown for them.
    Only the content manager shall be able to organize.
    Regards,
    Susanne

    I got the solution by myself:
    In the KM repositories click on the context menue of /documents/links and choose 'Details'.
    In the opened window choose Settings > Permissions and change the permission you like.

  • Microsoft Access Text Driver missing! and ...Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

    In order to use OpenRowSet, I installded Microsoft Access Database Engine 2010. However, I could not find Microsoft Access Text Driver in Drivers of ODBC Data Source Administrator.  Could I get some help with that?
    Thank you very much!

    I am local admin and try to run the following script, but I got an error. Could anyone help me look at it?
    EXEC sp_configure 'show advanced options', 1
    go
    RECONFIGURE
    GO
    EXEC sp_configure 'ad hoc distributed queries', 1
    go
    RECONFIGURE
    GO
    SELECT * FROM OPENROWSET('MSDASQL',
    'Driver={Microsoft Access Text Driver (*.txt, *.csv)};
    DefaultDir=D:\;','SELECT * FROM Test.csv')
    Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
    Configuration option 'Ad Hoc Distributed Queries' changed from 1 to 1. Run the RECONFIGURE statement to install.
    OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
    Msg 7303, Level 16, State 1, Line 1
    Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

Maybe you are looking for

  • Issue in Sync-Async bridge(RFC to File) scenario

    Hi All, My scenario id RFC to file synchronous scenario.Following the below link, I configured everything and its working fine. I am working on SAP PI 7.31 Dual Stack. http://scn.sap.com/blogs/henrique/2007/08/02/syncasync-scenarios-without-bpm As me

  • Dyn SQL in Ref cursor?

    Hi all, I have a pkg as below and its err message in compile: create or replace PACKAGE PKG_DARTS1 is TYPE TY_PARTY_DETAIL1 IS RECORD (      PTY_TYPE xxx.yyyy%TYPE TYPE cur_partydetail1 IS REF CURSOR RETURN TY_PARTY_DETAIL1; procedure SP_GetPartyDeta

  • New nVidia cards to be supported

    At the road show event yesterday, I spoke with one of the vendors and also one of the Adobe guys (I won't name him for his sake, but trust me, he's one who would know all about this development). He mentioned two cards that have forthcoming official

  • Opening database read only

    I am unable to open database in read only mode i used SQL> STARTUP NOMOUNT ORACLE instance started. Total System Global Area 101784276 bytes Fixed Size 453332 bytes Variable Size 75497472 bytes Database Buffers 25165824 bytes Redo Buffers 667648 byte

  • SAP R3 4.5b running on Windows 2008 R2 and SQL 2008 R2

    Hi Trying to obtain information on compatability of SAP R3 4.5b running on Windows 2008 R2 and SQL 2008 R2 ? I understand that SAP may not support this? But would it actually work? Assuming we have a third party supporting it? Jay