473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

on datastructure plz solve this

i am having a single linked list say 5 node are present, and one
pointer that is pointing to 3rd node using this pointer only i have to
come to the 1st node..... or how can i get back to the 1st node........

Jan 5 '06 #1
3 1173

raju wrote:
i am having a single linked list say 5 node are present, and one
pointer that is pointing to 3rd node using this pointer only i have to
come to the 1st node..... or how can i get back to the 1st node........


<OT>
first of all you should be careful posting your homework assignments in
news groups, your teacher might also be monitoring them. you might be
accused of using unfare means.
secondly this is not the right group to ask, try some datastructure
related group.
</OT>

Jan 5 '06 #2
raju wrote:
i am having a single linked list say 5 node are present, and one
pointer that is pointing to 3rd node using this pointer only i have to
come to the 1st node..... or how can i get back to the 1st node........


(a) this is not a C question.

(b) if it were a C question, you haven't given us enough information;
what code have you already tried? What, exactly, went wrong?

(c) You can't. If you're careless enough to lose the pointer to the
list head, you can't backtrack. In the words of the doctor,
"don't do that.".

--
Chris "believes seventeen improbable things before coffee" Dollin
Seventeen, forty-two - what else is there?
Jan 5 '06 #3
raju wrote:
i am having a single linked list say 5 node are present, and one
pointer that is pointing to 3rd node using this pointer only i have to
come to the 1st node..... or how can i get back to the 1st node........


Some tipical posibilities are:

a) (obvious, but mandatory to remark): do you need to go again to 1st
node?. Review your algorithm to see if it is mandatory or not.
b) (also obvious): Keep a pointer to list head
c) Look for information about "double linked list".
....

Kind regards.

PS: Some prereplies to next 20 post: a) I've googled for
"datastructure" and in the first 5 answers there are 4 related to
language specific groups (including this one). In order to forward to
another group, I've decided to provided a few more keywords. b) I do
not debate why a person looks for information in groups instead of in a
book or teacher.

Jan 5 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Santosh | last post by:
Hello, I would like some input on choosing a datastructure and a algorithm. I have a text file which contains three strings(say name, phonenumber and city). The file contains a about a billion...
4
by: Prateek Basu | last post by:
Hi, Does there exist any resource (link or book) where one can find the solution for some datastructure and algorithm related problems. Pls provide the pointer. Thanks in advance.. Prateek
11
by: Jürgen Hochwald | last post by:
Hi Maybe this is a simple question, but I don't know how to solve. Background: A weather station connected to the serial port sends data packets. This data packets are containing variables fom...
7
by: Curious | last post by:
Hi, I have created my own data structure. Basically it is a two way 'stack', where I can push elements and pop elements both from top and bottom. I also included a counter to show the number...
0
by: lumirb | last post by:
Hello, I would like to disccuss with the following issue: We want to create database in which we can dynamically add attributes. The problem is, we do not know the datastructure before. The...
6
by: jason | last post by:
Hello, I have a question about what kind of datastructure to use. I'm reading collumn based data in the form of: 10\t12\t9\t11\n 24\t11\t4\t10\n ..... I now have a structure which allows me...
21
by: Pieter | last post by:
Hi, I need some type of array/list/... In which I can store objects together with a unique key. The most important thing is performance: I will need to do the whole time searches in the list of...
2
Digital Don
by: Digital Don | last post by:
Hi, Iwas trying to look for a STL datastructure in C++ where I can store structure variables and then get out value from it by just comparing the value as follows; The structure variable:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.