Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,179 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,376 people online right now. Registration is fast and FREE... Join Now!




Plz help me in this question

 
Reply to this topicStart new topic

Plz help me in this question, linklist and pointer

sid2008
29 May, 2008 - 10:18 AM
Post #1

New D.I.C Head
*

Joined: 1 Apr, 2008
Posts: 12

Hi everyone

I have posted before also actually i have some problems in my exam yesterday.I could not solve it.If anyone has answer try to reply me..[code]Consider the following C++ declarations for problems 1 through 10. Complete any 7 of the 10 problems. Extra credit will be given to additional correct problems.

typedef int elementType;

class node1{
friend class list1;
private:
elementType data;
node1 * next;
};

class node2{
friend class list2;
private:
elementType data;
node2 * next;
node2 * prev;
};

class list1 {
public:
list1() {first =NULL;}//constructor
. . . //other member functions

private:
node1 * first;
};


class list2 {
public:
list2() {first =NULL;}//constructor
. . . //other member functions

private:
node2 * first;

};


The questions are

5. Write a member function to insert a new node at the beginning a singly linked list. The parameter to the function holds the data for the new node.

void list1::insert(elementType x)




6. Rewrite Problem 5 using a doubly linked list.

void list2::Insert (elementType x).

8. Write a function to print out the data in a single linked list.

void list1::print()


If someone know it answers plz let me know..I am just trying to know it bec of my curiosity....plz plz help me



User is offlineProfile CardPM
+Quote Post

realNoName
RE: Plz Help Me In This Question
29 May, 2008 - 11:16 AM
Post #2

D.I.C Regular
***

Joined: 4 Dec, 2006
Posts: 300



Thanked: 5 times
My Contributions
ok how about you try for you self and then if you have any problems then we can help you but come on i gave you the code for 2 of the questions AmitTheInfinity told you another answer so there are 3 answers out of the 10 given to you without you doing ANY work

http://www.dreamincode.net/forums/showtopic53298.htm
http://www.dreamincode.net/forums/index.ph...c=53256&hl=
User is offlineProfile CardPM
+Quote Post

sid2008
RE: Plz Help Me In This Question
29 May, 2008 - 12:30 PM
Post #3

New D.I.C Head
*

Joined: 1 Apr, 2008
Posts: 12

QUOTE(realNoName @ 29 May, 2008 - 12:16 PM) *

ok how about you try for you self and then if you have any problems then we can help you but come on i gave you the code for 2 of the questions AmitTheInfinity told you another answer so there are 3 answers out of the 10 given to you without you doing ANY work

http://www.dreamincode.net/forums/showtopic53298.htm
http://www.dreamincode.net/forums/index.ph...c=53256&hl=



Thanks for ur help..but i dont want to take anything without help.I dint do in exam thatsway i am asking you. Actually my concept is not clear about the linklist.I have tried lot but could not make it.Well thanks 4 ur previous help .And if you will give me answer than it would be good for me...The whole questions related to linklist chapter i have dropped in exam. I thought here we can ask any questions that we dont know about the C++ thatsway i posted questions here..Thanks for help
User is offlineProfile CardPM
+Quote Post

realNoName
RE: Plz Help Me In This Question
29 May, 2008 - 02:06 PM
Post #4

D.I.C Regular
***

Joined: 4 Dec, 2006
Posts: 300



Thanked: 5 times
My Contributions
your right this forum is for asking questions and my self and others are more then happy to help you but D.I.C has a rule that we need to see some kind of effort before we give you the help/code in fact when you made the topic there is a nice yellow box at the top of the page that have six basic rules before you post

i dont care if your not even close to the answer we just need something some kind of effort

if you need more help on the concept of link lists born2c0de has made a tutorial on data structures or here is another page that i like that goes over the concept of link lists

This post has been edited by realNoName: 29 May, 2008 - 02:06 PM
User is offlineProfile CardPM
+Quote Post

sid2008
RE: Plz Help Me In This Question
30 May, 2008 - 07:40 AM
Post #5

New D.I.C Head
*

Joined: 1 Apr, 2008
Posts: 12

QUOTE(realNoName @ 29 May, 2008 - 03:06 PM) *

your right this forum is for asking questions and my self and others are more then happy to help you but D.I.C has a rule that we need to see some kind of effort before we give you the help/code in fact when you made the topic there is a nice yellow box at the top of the page that have six basic rules before you post

i dont care if your not even close to the answer we just need something some kind of effort

if you need more help on the concept of link lists born2c0de has made a tutorial on data structures or here is another page that i like that goes over the concept of link lists



hey realnoname !!

Thanks for ur links...i would take care when i post my question again. I have posted the one question .and i show my efforts also plz try to see it and reply me my answer is right or wrong? thanks for your help again
User is offlineProfile CardPM
+Quote Post

loudhelper
RE: Plz Help Me In This Question
30 May, 2008 - 05:09 PM
Post #6

New D.I.C Head
*

Joined: 30 May, 2008
Posts: 1

QUOTE(sid2008 @ 30 May, 2008 - 08:40 AM) *

QUOTE(realNoName @ 29 May, 2008 - 03:06 PM) *

your right this forum is for asking questions and my self and others are more then happy to help you but D.I.C has a rule that we need to see some kind of effort before we give you the help/code in fact when you made the topic there is a nice yellow box at the top of the page that have six basic rules before you post

i dont care if your not even close to the answer we just need something some kind of effort

if you need more help on the concept of link lists born2c0de has made a tutorial on data structures or here is another page that i like that goes over the concept of link lists



hey realnoname !!

Thanks for ur links...i would take care when i post my question again. I have posted the one question .and i show my efforts also plz try to see it and reply me my answer is right or wrong? thanks for your help again



sid2000 let me guess... Siddhiben? im in that class too sadly
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 11:08AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month