PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > linked list
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linked list

Réponse
 
LinkBack Outils de la discussion
Vieux 31/01/2008, 22h07   #1
MJK
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut linked list

Hello all,

When I am using array in structure to read a pedigree, I can simply
call an index to see how old is the dad of individual 'i':

Individual[ individual[i].dad_id ].Age

The above example is in a coded pedigree (pedigree starts from
individual '0').

I am wondering how I can do the same as above when I am using the
linked list.

Thanks,
MJ
  Réponse avec citation
Vieux 31/01/2008, 22h12   #2
Walter Roberson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: linked list

In article <3a727575-d6c7-47a9-a1c6-e84236b9b466@j78g2000hsd.googlegroups.com>,
MJK <jafarikia@gmail.com> wrote:

>When I am using array in structure to read a pedigree, I can simply
>call an index to see how old is the dad of individual 'i':


>Individual[ individual[i].dad_id ].Age


>The above example is in a coded pedigree (pedigree starts from
>individual '0').


>I am wondering how I can do the same as above when I am using the
>linked list.


If you transform individual into a linked list instead of an
array, then NO, C does not provide any operations to traverse
from the head of a list to the i'th node. On the other hand, you
can easily write your own routine that returns a pointer to
the i'th node, and then use:

find_ith( individual, find_ith( individual, i)->dad_id )->Age
--
'Roberson' is my family name; my given name is 'Walter'.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h47.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09541 seconds with 10 queries