Hi! its my first time to use linked list...... all I know is to store one value in each node. But is it possible to store multiple values in each node of a linked list.
For example : Node a has the following data: (1) Name (2) address (3) Tel. #.
could you show some code on how to implement this?
It's urgent... I need this info asap.
Linked List Question!
Page 1 of 112 Replies - 1536 Views - Last Post: 01 October 2007 - 09:34 PM
Replies To: Linked List Question!
#2
Re: Linked List Question!
Posted 01 October 2007 - 07:42 PM
Hello marckiestar, read the rules first. You must exert some effort to write your codes, then post here together with your problems which you encountered. There are many people who are willing to help you.
#3
Re: Linked List Question!
Posted 01 October 2007 - 07:50 PM
Quote
But is it possible to store multiple values in each node of a linked list.
Yes, it is.
Simply create your node structure like this:
struct node
{
int data1;
char data2;
/* ... */
float dataN;
struct node *next;
};
You can also read this Data Structures Tutorial to learn how a Linked List works.
#5
Re: Linked List Question!
Posted 01 October 2007 - 08:03 PM
that tutorial helps a lot..
#7
Re: Linked List Question!
Posted 01 October 2007 - 08:45 PM
Hi everyone!
Thank You for your reply........ But its really difficult ot understand the tutorials.....we are using borland c++ 1991 and it doesn't use using namespace and whatsoever...... could you translate the tutorial using the header files conio.h, iostrem.h, stdlib.h, stdio.h?
thank you for your reply.......
Thank You for your reply........ But its really difficult ot understand the tutorials.....we are using borland c++ 1991 and it doesn't use using namespace and whatsoever...... could you translate the tutorial using the header files conio.h, iostrem.h, stdlib.h, stdio.h?
thank you for your reply.......
#8
Re: Linked List Question!
Posted 01 October 2007 - 08:57 PM
Download the latest version of Borland. I am using Borland 5.5 and it supports the latest ISO.
Linked List Implementation is Intermediate,I guess. One way of learning is reading the tutorial.
Linked List Implementation is Intermediate,I guess. One way of learning is reading the tutorial.
#9
Re: Linked List Question!
Posted 01 October 2007 - 08:57 PM
born2c0de are you saying that you declare all the possible content of the node inside the struct on the top, then when you enter the values, it may look like this?
int x;
char y;
when inputting content of the node:
p->next->x=123;
p->next->y=h;
could p->next appear at the same time?
int x;
char y;
when inputting content of the node:
p->next->x=123;
p->next->y=h;
could p->next appear at the same time?
#10
Re: Linked List Question!
Posted 01 October 2007 - 09:06 PM
nirvanarupali the compiler we are using at school is borland c++ 1991 and we could not modify that
nirvanarupali taga philippines ka din pala..... taga san ka....alam mo magtagalog?
nirvanarupali taga philippines ka din pala..... taga san ka....alam mo magtagalog?
#11
Re: Linked List Question!
Posted 01 October 2007 - 09:19 PM
Cebu City. We can't speak our language here. Avoid that, we are composed of international members here.
Try to convinced you school professor or administrator to change your old compiler, it would be a big mess if you are studying C++, the old way, I mean not in ISO. You are not in the right track.
Try the link which I give above. I learned a lot from that.
Try to convinced you school professor or administrator to change your old compiler, it would be a big mess if you are studying C++, the old way, I mean not in ISO. You are not in the right track.
Try the link which I give above. I learned a lot from that.
#12
Re: Linked List Question!
Posted 01 October 2007 - 09:23 PM
nirvanarupali can you give me a sample code the one that is easy to understand... a code in your own way....just a bit.....please... im just a beginner....by the way how old r u? Im just 17
#13
Re: Linked List Question!
Posted 01 October 2007 - 09:34 PM
Page 1 of 1

New Topic/Question
Reply



MultiQuote



|