?
Solved

Singly linked list

Posted on 2007-03-21
8
Medium Priority
?
342 Views
Last Modified: 2010-04-16
Hi, I have this code:

public class IntNodoLSL
    {
        public int info;
        public IntNodoLSL next;
        public IntNodoLSL(int i)
        {
            this(i, null);
        }
        public IntNodoLSL(int i, IntNodoLSL n)
        {
            info = i; next = n;
        }
    }

it creates a node for a singly linked list but in the line this(i,null) when I compile it it marks an error "Method name expected" what can be wrong?

Thank you!!!
0
Comment
Question by:gothic130
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 18766509
try ...

this.IntNodoLSL(i, null);

also why write this when there is already a LinkedList<T> class? :)
0
 

Author Comment

by:gothic130
ID: 18766567
Could you explain this:    "also why write this when there is already a LinkedList<T> class?"
maybe my problem is that I don't realy understand the code!

thank you!
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 18766622
I mean why write a SinglyLinked list when there is a class in the framework already that is a linkedlist :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:gothic130
ID: 18766653
Could you tell me where is it???

:)
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 200 total points
ID: 18766706
http://msdn2.microsoft.com/en-us/library/he2s3bh7.aspx its doubly linked but close enough :)

0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 18766726
you mat also want to look at List<T> which is a list implemented as a dynamically sized array.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 18766748
whoops missed that they were constructors for your original question the answer to that is change it to ...


        public IntNodoLSL(int i) :  this(i, null);
        {
        }
0
 

Author Comment

by:gothic130
ID: 18766788
You are right!!!!   Thank you very much!  It works now:

public IntNodoLSL(int i) :  this(i, null)
{
}
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question