Implementing Set using BST

Hi, I am implementing the Set using Binary Search tree but am stuck and I cannot go further. Could someone help me get this code working? I am trying to make the add method to work but it does not compile and it says it cannot find the compareTo(java.lang.Object) method. When i don't have the compareTo method, it says i have to override the compareTo. I think i can get the contains method working if the add method works. Code below:
import java.util.*;
import java.lang.*;
public class SetImplementation<E> implements SimpleSet <E> {
    private TreeNode root ;
    private int NodeCount ;
  public SetImplementation() {
      root = null ;
      NodeCount = 0 ;
  public boolean add(Object obj) {
     if(root == null) {
        root = new TreeNode(obj) ;
        NodeCount++ ;
        return true ;
   return recursiveAdd(root, obj) ;
public boolean recursiveAdd(TreeNode node, Object obj) {
     int compareResult = (node.getObj().compareTo(obj)) ;
         if(compareResult == 0) {
            System.out.println("You cannot duplicate values") ;
            return false;
         else if(compareResult < 0) {
            node.left = add( node.left, obj );
            NodeCount++ ;
            return true ;
         else if(compareResult > 0) {
            node.left = add( node.right, obj );
            NodeCount++ ;
            return true ;
  public boolean contains(Object o) { return false ;  }
  public boolean isEmpty() { return root == null ; }
  public int size() { return NodeCount ; }
  public void clear() { root = null ;  }
  public class TreeNode implements Comparable {
      Object obj ;
      TreeNode left , right ;
      public TreeNode(Object o) {
          obj = o ;
          left = null ;
          right = null ;
      public int compareTo(Object other) {
         return 1; //I don't know how to do the comparison. I hav never used this interface
      }             //I never used the comparable interface before, so i am just out of ideas
    }               //So i just try to return an integer to se if it works. BUt it does not.
 

You're comparing the Object references from your TreeNode classes but these are not Comparable. So, you should store Comparables in your TreeNode's. And you also want to add types to your tree that are Comparable, right?
If I were you, I'd first try to get this working without the generics (the strange brackets: <E>). When that works, extend your code using generics. Here's a small start:
class SetImplementation implements SimpleSet {
    public boolean add(Comparable obj) { // <-- Comparable here!
        return recursiveAdd(root, obj) ;
    private boolean recursiveAdd(TreeNode node, Comparable obj) { // <-- Comparable here! (and made it 'private')
        int compareResult = node.obj.compareTo(obj) ;
    public class TreeNode {
        Comparable obj ; // <-- Comparable here!
}

Similar Messages

  • How to do a SET using SNMP ?

    Hi,
    I already ask in the forum Advanced Language Topics
    http://forum.java.sun.com/thread.jsp?forum=4&thread=320674
    but I din't receive any answer so I try here maybe some one could help me on this ... ;-)
    I find a nice piece of code on Internet to do SNMP request �
    http://membres.lycos.fr/ysoun/index.html
    http://membres.lycos.fr/ysoun/sck.zip
    It works find to do some GET operations like doing a GET sysDescr (oid 1.3.6.1.2.1.1.1.0).
    But I would like to do a SET operation but I could'nt succeed.
    First I do a get on an oid 1.3.6.1.2.1.1.4.0 (sysContact) and I get the value "hello" which is find and I would like to set this value to "good bye".
    Well I have to say that I don�t know very well the SNMP protocol and I couldn�t figure out where to put the value in order to set "Good bye". Off course I have the right community to do that but I just can't figure out how can I do that ...
    Any comment ... help ... ideas ... are more than welcome !!!! Or maybe some better SNMP package to do that???
    thanks,
    Emmanuel
    Here is the code:
    the function to set using SNMP ...
      public static setSnmpRequest(int snmpPort, int snmpTimeout, String community, String host, String strValue){
          String oid = new String("1.3.6.1.2.1.1.4.0");
          D_SNMP.Message request;
          try {
              InetAddress snmpHost = InetAddress.getByName(host);
              DatagramSocket sock = new DatagramSocket();
              sock.setSoTimeout(snmpTimeout);
              // create pdu.
              //somewhere here I should include my variable "good bye" but I don't really know how
              Var var = new Var(oid);
              OctetString c = new OctetString(community);
              D_SNMP.Integer requestId = new D_SNMP.Integer(0);
              D_SNMP.Integer errorIndex = new D_SNMP.Integer(0);
              D_SNMP.Integer errorStatus = new D_SNMP.Integer(0);
              //For the GET:
              //PduCmd pdu = new PduCmd(Pdu.GET,requestId,errorStatus,errorIndex,new VarList(var));
              //What I would like to do:
              PduCmd pdu = new PduCmd(Pdu.SET,requestId,errorStatus,errorIndex,new VarList(var));
              D_SNMP.Message m = new D_SNMP.Message(c,pdu);
              // send
              byte[] b = m.codeBer();
              DatagramPacket packet = new DatagramPacket(b,b.length,snmpHost,snmpPort);
              byte[] b2 = new byte[1024];
              DatagramPacket p2 = new DatagramPacket(b2,b2.length);
              long startTime = System.currentTimeMillis();
              sock.send(packet);
              sock.receive(p2); // block or ... timeout.
              long time = (System.currentTimeMillis() - startTime);
              // display
              ByteArrayInputStream ber = new ByteArrayInputStream(b2,1,p2.getLength()-1); // without tag !
              D_SNMP.Message m2 = new D_SNMP.Message(ber);
              System.out.println("snmpPing " + host + " :");
              System.out.println(m2.getPdu().getVarList().elementAt(0) + " / time = " + time + "ms" );
              if (debug){
                  StringBuffer buf = new StringBuffer();
                  m2.println("",buf);
                  System.out.println(buf);
          } catch (UnknownHostException ex){
              System.out.println(host + ": unknown host." );
          } catch (InterruptedIOException ex){
              System.out.println("snmpPing "+ host + " : Time-out." );
          } catch ( Exception ex) {
              System.out.println("Error in : ");
              System.out.println(ex);
      } the class Var... where somewhere I should be able to set the variable "Good bye" ...
    import java.io.*;
    import java.util.Vector;
    /** ASN.1 grammar for Var:
    * Var ::=
    * SEQUENCE
    *        { name Oid
    *          value CHOICE {Null, Integer, Counter, gauge, Timeticks, IpAddress, OctetString}
    final public class Var extends construct implements Serializable {
      public Var(Oid o, smi s){
        this();
        valeur.addElement(o);
        valeur.addElement(s);
      /** Same as Var(new Oid(oid), new Null()).
      public Var(String oid) throws IOException{
        this(new Oid(oid), new D_SNMP.Null());
      /** Builds a Var from a ByteArrayInputStream holding a Var Ber coding.
       *  <BR>Bytes read are removed from the stream.
       *  <P><B>Note:</B> The ByteArrayInputStream must not contain the Var Tag.
       *  @exception IOException is thrown if a problem occurs while trying to decode the stream.
      public Var(ByteArrayInputStream inBer) throws IOException{
        this();
        decodeBer(inBer);
      /** Used only by VarList.
      Var(){
        super(smi.SEQUENCE_tag);
        valeur = new Vector(2);
      /** Returns the name of this Var.
      public Oid getName(){
        return (Oid) valeur.elementAt(0);
      /** Returns the value of this Var.
      public smi getValue(){
        return (smi) valeur.elementAt(1);
      /** Returns the value of this Var as a String.
      public String toString() {
        try{
        return ((smi)valeur.elementAt(0)).toString() + " = " + ((smi)valeur.elementAt(1)).toString();
        }catch (IndexOutOfBoundsException e) { // ne doit pas se produire.
          System.out.println("Erreur codage interne type Var.");
          System.exit(1);
        return null;
      /** Used smi.decodeBer().
      void decodeValeur(ByteArrayInputStream bufferBer, int lgBerValeur) throws IOException {
        int tag = bufferBer.read();
        if ( tag != smi.OID_tag )
          throw new IOException ("erreur decodage tag Oid de Var: byte " + java.lang.Integer.toHexString(tag) +" recu.");
        Oid name = new Oid(bufferBer);
        this.valeur.addElement(name);
        // lis l'objet suivant.
        tag = bufferBer.read();
        try{
        smi _valeur = smiFactory.create(tag,bufferBer);
        this.valeur.addElement(_valeur);
        } catch (IOException e){
          throw new IOException ("erreur decodage champ Valeur : " + e);
      /** Custom serialization: Ber coding is written in ObjectOutputStream.
      private void writeObject(ObjectOutputStream out) throws IOException{
        byte b[] = this.codeBer();
        out.writeInt(b.length);
        out.write(b);
        out.flush();
      private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        this._tag = smi.SEQUENCE_tag;
        this.valeur = new Vector();
        int len = in.readInt();
        byte b[] = new byte[len];
        in.readFully(b);
        this.decodeBer(new ByteArrayInputStream(b,1,b.length-1));
    } the class VarList ...
    import java.io.*;
    import java.util.Vector;
    /** ASN.1 grammar for VarList:
    * VarList ::=
    * SEQUENCE OF Var
    final public class VarList extends construct {
      /** Constructs a VarList holding a single Var.
       *  @param Var to be held by Varlist
       public VarList(Var v){
         super(smi.SEQUENCE_tag);
         valeur = new Vector(1);
         valeur.addElement(v);
      /** Constructs a VarList holding Vars.
       *  @param v Vector of Vars.
       public VarList(Vector v){
         super(smi.SEQUENCE_tag);
         valeur = (Vector) v.clone();
       /** Constructs a VarList holding Vars.
       *  @param tab array of Vars.
       public VarList(Var[] tab){
         super(smi.SEQUENCE_tag);
         int taille = tab.length;
         valeur = new Vector(taille);
         for (int i=0; i<taille; i++)
           valeur.addElement(tab);
    /** Builds a VarList from a ByteArrayInputStream holding a VarList Ber coding.
    * <BR>Bytes read are removed from the stream.
    * <P><B>Note:</B> The ByteArrayInputStream must not contain the Var Tag.
    * @exception IOException is thrown if a problem occurs while trying to decode the stream.
    public VarList(ByteArrayInputStream inBer) throws IOException{
    super(smi.SEQUENCE_tag);
    valeur = new Vector();
    decodeBer(inBer);
    /** Returns the Var at the specified index.
    public Var elementAt(int i) throws IndexOutOfBoundsException {
    return (Var)valeur.elementAt(i); // Sans soucis: Var est immutable
    /** Returns the number of Var held this VarList.
    public int getSize(){
    return valeur.size();
    /** Used by smi.decodeBer().
    * A VarList is in fact an array of Vars.
    void decodeValeur(ByteArrayInputStream bufferBer, int lgBerValeur) throws IOException {
    Var v;
    int lg;
    try{
    while (lgBerValeur >0){
    int tag = bufferBer.read();
    lgBerValeur --;
    if ( tag != smi.SEQUENCE_tag )
    throw new IOException ("error decoding tag Var in VarList: byte " +
    java.lang.Integer.toHexString(tag) +" read.");
    v =new Var();
    lg = v.decodeBer(bufferBer);
    this.valeur.addElement(v);
    lgBerValeur -= lg;
    } catch (IOException e){
    throw new IOException ("error decoding Value : " + e);

    I read the documentation it does not help me much, (it's generated by javadoc and there is not enought comment to understand the whole thing ... in fact it just miss a sample of SET request and it would be perfect ...
    thanks,
    emmanuel
    PS: I'm going to try the author again
    PS: Still ... any help or pakage to do SET request using SNMP are more than welcome ...

  • Implement Set Interface

    I have been give the task of "implementing the Set interface" in Java for a project. I believe what needs to be done is overwriting the methods I need from the Set interface, but I'm not exactly sure if this is correct, or how I would start to do this. Could anyone point me in the right direction? TIA
    Edited by: prem1era on Jul 8, 2009 7:19 AM
    Edited by: prem1era on Jul 8, 2009 7:25 AM

    Ok, now that I understand more what I am doing, I have another question and maybe I should post a new topic for it, but I'll see if I can get any responses here first. Now that I am implementing Set correctly my goal is to use Set to store an object in a file instead of in memory. So this is what I have so far. For the add method, I am planning on using the object as an argument. I want to check to make sure that the object being added is not already included in that file. So within the add method I am going to read through the file, look for that object and if it is not present I am going to add it. Else, I will be returning false. Does this sound correct?
    import java.io.FileWriter;
    import java.io.PrintWriter;
    import java.util.Collection;
    import java.util.Iterator;
    import java.util.Set;
    public class RegistrySet implements Set {
         private String registryFile;
         private PrintWriter pw;
         public RegistrySet(String registryFile){
              this.registryFile = registryFile;
         public boolean add(Object o) {
              return false;
         }

  • How to Submit a Concurrent Request Set Using a Self-Service Page

    Hi all,
    I would like to know how to Run/Submit a Concurrent Request Set Using a Self-Service Page
    Thanks.
    Bench

    Hi all,
    I would like to know how to Run/Submit a Concurrent Request Set Using a Self-Service Page
    Thanks.
    Bench

  • When opening iTunes, I get the following error message: the registry setting used by the iTunes drivers for importing an burning CDs and DVDs are missing.  This can happen as a result of installing other CD burning software.  Please reinstall iTunes.

    When opening iTunes, I get the following error message: "The registry setting used by the iTunes drivers for importing an burning CDs and DVDs are missing.  This can happen as a result of installing other CD burning software.  Please reinstall iTunes."
    I have reinstalled iTunes twice and still get the message.
    Any clues??
    Thank you.

    I'd start with the following document, with one modification. At step 12 after typing GEARAspiWDM press the Enter/Return key once prior to clicking OK. (Pressing Return adds a carriage return in the field and is important.)
    iTunes for Windows: "Registry settings" warning when opening iTunes

  • Problem in creating a new set using GS01

    Dear all,
    I am trying to create a set using Tcode - GSO1.
    But wehn try to create a SET with Basic Set it is asking for a ref table
    can you please help with some links about creating SETS.
    I want to create aset where we can maintian a list of Specific userid.
    Regards,
    Gaurav Sood

    Issue resolved

  • Set used in FI Validation 'IN' clause

    Dear friends,
    Looking for Set used in FI Validation 'IN' clause.
    Regards,
    Praveen Lobo

    Dear friends,
    Looking for tcode for Set used in FI Validation 'IN' clause.
    Regards,
    Praveen Lobo

  • How to bypass printer setting using abap code?

    Dear All,
    I want to bypass printer setting using abap code?
    I am printing sticker using a code and i dont want to display printer setting .
    I want direct ouput ?
    Regards
    Steve

    Are you using reports or scripts/smart forms? You can use the parameter for no_dialog = space(use the relevant parameter).

  • Create document set using ECMA Script

    Hi,
    I want to create a document set in SharePoint 2010 document library where i have already included document set content type.
    Is there any way to create a document set using ECMA Script?? If yes, then please provide the sample code for this...
    Thanks.
    -Prashant

    Hi Prashant,
    Although this post is aimed at SP 2013 and the App model, it should give you the object model references you need to complete your goal:
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    In particular the following function should be of use:
    function CreateDocumentSet() {
    var ctx = new SP.ClientContext("http://yourSharePointSite");
    var parentFolder;
    var newDocSetName = $('#txtGetDocumentSetName').val();
    var docSetContentTypeID = "0x0120D520";
    var web = ctx.get_web();
    var list = web.get_lists().getByTitle('DocSetLibrary');
    ctx.load(list);
    parentFolder = list.get_rootFolder();
    ctx.load(parentFolder);
    var docsetContentType = web.get_contentTypes().getById(docSetContentTypeID);
    ctx.load(docsetContentType);
    ctx.executeQueryAsync(function () {
    var isCreated = SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());
    ctx.executeQueryAsync(SuccessHandler('Document Set creation successful'), FailureHandler("Document Set creation failed"));
    }, FailureHandler("Folder loading failed"));
    ctx.add_requestSucceeded(function () {
    $('#txtGetDocumentSetName').val('');
    alert('Request Succeeded');
    ctx.add_requestFailed(function (sender, args) {
    alert('Request failed: ' + args.get_message());
    // Failure Message Handler
    function FailureHandler(message) {
    return function (sender, args) {
    alert(message + ": " + args.get_message());
    // Success Message Handler
    function SuccessHandler(message) {
    return function () {
    alert(message);
    Keith Tuomi | Twitter: @itgroove_keith | Blog:
    http://yalla.itgroove.net
    Please click "Propose As Answer" if a post solves the problem or "Vote As Helpful" if a post has been useful to you.

  • Setting Multiple values in property set using java API

    Hello All,
    I want to set the properties of a profile in a property set using java API provided
    in package p13n. The property can have multiple values. When I try to add the
    property using ProfileManager.setProperty() method. But every time I do it this
    way, it replaces the earlier value of property and not added. This, I can achieve
    using portalTools but I want to use the API for user registration on the site.
    I hope the query is clear.
    Waiting for a response,
    Thanks in advance,
    Shrinivas

    You need to use java.util.ArrayList.
    First cast the existing value into ArrayList using getProperty method,
    change values in the ArrayList and then put them back with setProperty
    method.
    Regards,
    Michael Goldverg
    "Shrinivas Rao" <[email protected]> wrote in message
    news:3d64e7d9$[email protected]..
    >
    Hello All,
    I want to set the properties of a profile in a property set using java APIprovided
    in package p13n. The property can have multiple values. When I try to addthe
    property using ProfileManager.setProperty() method. But every time I do itthis
    way, it replaces the earlier value of property and not added. This, I canachieve
    using portalTools but I want to use the API for user registration on thesite.
    I hope the query is clear.
    Waiting for a response,
    Thanks in advance,
    Shrinivas

  • Implementing  jdbc using jsp and servlets

    please give me documnetation and few programs with code .
    implementing or using jdbc with servlets and jsp.

    please give me documnetation and few programs with
    code .
    implementing or using jdbc with servlets and jsp.Well, which do you want to do? Implement JDBC with servlets and JSP - a tricky job, but there's no technical reason why you couldn't for instance write a class which both extends HttpServlet and implements java.sql.Driver. Wouldn't recommend it, though

  • Can we Implement YTD using MDX syntax in olap universe.

    Hi,
    I am trying to implement YTD prompt from universe level. Can any one suggest how can i implement it using MDX syntax in olap universe.
    Regards,
    Anil Kumar.

    Hi,
    In MDX, you need to generate the technical name to have you expression valid.
    Moreover the correct syntax is: SUM(MTD(member),measure)
    So in your case the prompt must be constrained on the technical name and cannot be free, the correct syntax is:
    <EXPRESSION> SUM(MTD(@Prompt('YYYYMM','A','Cal. year / month\L01 Cal. year / month',mono,primary_key)),
    @(Select(Key Figures\Total Variance)) </EXPRESSION>
    Last, the result will be not really significant because you are asking for a MTD with a Year-Month as time member: the result will be the measure value for the selected month.
    In your case you need to have a time series function for an upper level like YTD or QTD. If you want to use MTD, the the time member selected would be at a lowest level, such as week or day.
    Regards
    Didier

  • How to add a file in Document Set using ECMA script?

    Hi,
    I want to upload a particular file into Document set using ECMA script.
    I can do it easily through C# but unable to achieve the same using ECMA Script.
    Any pointers or piece of code will be helpful.
    Thanx in advance :)
    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"

    The following blog post provides a way to create a document set using ECMA:
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    The following blog post provides a way to upload files into a document set using CSOM:
    http://www.c-sharpcorner.com/Blogs/12139/how-to-create-document-set-using-csom-in-sharepoint-2013.aspx
    See if you can follow the logic in the CSOM example to apply it to ECMA. Let me know if you have specific problems with it.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • SWs needed to implement SSO using AM

    Hi,
    I want to know what all SWs are needed to implement SSO using sun AM.
    I tried implementing SSO using AM along with Policy Agent. But somewhere I am missing something.
    Does anyone know of any simple doc which explains the steps in clearly with confusion?
    Thanks
    Rahul A Honrao

    Try these links, good start ups:
    http://www.sun.com/software/products/access_mgr/index.jsp
    http://developers.sun.com/identity/reference/techart/install.html
    http://docs.sun.com/app/docs/prod/sjs.policy.agt22~1322.1#hic

  • Problem building record set using Dreamweaver CS6 Cloud Product

    I am having a problem building a Results Page using Dreamweaver CS6.  I have followed all the steps described in Dreamweaver/Build Search and Results Page Article (multiple times).  It seems that when I save the Results page it does not copy the php used to build the dynamic table.  In fact when I view the source, I do not see any php code. 
    Additionally, when I attempt to bind the record set, it also does not accept the Default Value(s).  Enstead it gives me a list of all data in the colum(s) chosen for the record set (using Where..LIKE..variable definition).
    Any suggestions?
    Regards,
    Norv

    Yes, I will be glad to go through each step.  I will also provide code.
    Step 1:  Built the Search Page by adding Form into exisitng htm page.  Used Insert> Form>Form to insert Form area.  Then added three (3) text fields using Text Icon from the Form Menu Bar (Classic View).
    Step 2: Added a Submit and Reset Button to the Search Page.  Again used the Form Menu Bar to create the Buttons.
    Step 3: Selecte the <form> tag at bottom of Document Window to point Form to the Results Page (using the Action Box.
    Saved page and then began building the Results Page using an existing htm page.  Saved the Results Page as a .php document.
    Results Page:  Here are steps taken to build Results Page (Code will follow):
    1/ On the Results Page created a Recordset using the bindings dialog box.  Used the Advanced Recordset Dialog Box.  In the Advanced Dialog Box I used the Select and Where features to create a Recordset that created a 3 column table (records.County, records.ListPrice, records.PropertyType).  In the Variable box I created 3 variables (varCounty, varListPrice, varPropertyType).  varCounty and varPropertyType parameters are text (Type) and % (for Default Value).  varListPrice parameters are floating point (type) and % (for Default Value).  RunTime Value is $_REQUEST["ColumnName"].
    Here is the Code generated by Dreamweaver.  Note, I am not including the code to access the database, because in all tests I am able to access the table.  In fact first time I built the dynamic table, everything worked and I saw the Colum and default value.  Have never been able to duplicate that effort.  :-)
    Here is code:
    <?php
    if (!function_exists("GetSQLValuestring")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    if (PHP_VERSION<6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) :
    mysql_escape_string($theValue);
    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "". $theValue ."" : "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "".  $theValue ."" : "NULL";
    break;
    case "defined"
    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
    break;
    return $theValue;
    $varCounty_rslistings = "%";
    if (isset($_GET["County"])) {
    $varCounty_rslistings = $_Get["County"];
    $varListPrice_rslistings = "%";
    if (isset($_GET["ListPrice"])) {
    $varListPrice_rslistings = $_GET["ListPrice"];
    $varPropertyType_rslistings = "%";
    if (isset($_GET["PropertyType"])); {
    $varPropertyType_rslistings = $_GET["PropertyType"];
    mysql_select_db($database_MyDB, $MyDB);
    $query_reslistings = sprintf("SELECT records.County, records.ListPrice, records.PropertyType FROM records WHERE records.County LIKE %s AND records.ListPrice LIKE %s AND records.PropertyType LIKE %s", GetSQLValueString($varCounty_rslistings, "text"),GetSQLValueString($varListPrice_rslistings,"double"),
    GetSQLValueString($varPropertyType_rslistings,"text"));
    $rslistings = mysql_query($query_rslistings, $MyDB) or die(mysql_error());
    $row_rslistings = mysql_fetch_assoc($rslistings);
    $totalRows_rslistings = mysql_num_rows($rslistings);
    ?>
    That's the code that was generated by Dreamweaver. 
    Thanks in advance for your assistance

Maybe you are looking for