473,467 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to learn lists in C

I have some difficulties to learn lists and its
coding in C language.

Is there a site that explain this argument in a simple
way (with examples of course)?

I tried to "google" but results are huge and
I don't know what to choose.

Thanks in advance
Nov 15 '05 #1
4 1430
"__frank__" <__*******@spam.yourself.against.a.w.all> wrote in message
news:ai******************@twister2.libero.it...
I have some difficulties to learn lists and its
coding in C language.


New item: allocate memory, fill in data, set "next" pointer to null, set
current end pointer (was null) to it. Simple.

--
Mabden
Nov 15 '05 #2
Skarmander ha scritto:
http://cslibrary.stanford.edu/103/,


Very good.

Thanks

Nov 15 '05 #3
Mabden wrote:
"__frank__" <__*******@spam.yourself.against.a.w.all> wrote in message
news:ai******************@twister2.libero.it...

I have some difficulties to learn lists and its
coding in C language.


New item: allocate memory, fill in data, set "next" pointer to null, set
current end pointer (was null) to it. Simple.


to "__frank__": Mabden's post only describes (very briefly) how to add
an item to the end of a list. It definitly isn't a complete
introduction to linked lists. The other replies you received looked ok.
Note: Although I "plonked" Mabden I don't actually use kill files. I
have responded to this post because his answer was poor and many
regulars have kill-filed him.
--
Nick Keighley

Nov 15 '05 #4
"Nick Keighley" <ni******************@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Mabden wrote:
"__frank__" <__*******@spam.yourself.against.a.w.all> wrote in message
news:ai******************@twister2.libero.it... I have some difficulties to learn lists and its
coding in C language.


New item: allocate memory, fill in data, set "next" pointer to null, set current end pointer (was null) to it. Simple.


to "__frank__": Mabden's post only describes (very briefly) how to add
an item to the end of a list. It definitly isn't a complete
introduction to linked lists. The other replies you received looked

ok.

Mine's not OK? Not even OK? BTW, I was not actually going for a complete
introduction, but I challenge you to make a better one in under 20
words. Especially one better than OK.
Note: Although I "plonked" Mabden I don't actually use kill files. I
have responded to this post because his answer was poor and many
regulars have kill-filed him.


Ah, politics. Isn't that a little off-topic in a thread titled, "
How to learn lists in C"?

OK, perhaps something to entertain the more advanced programmer,
something I am trying out for my Sudoku game:

http://arxiv.org/PS_cache/cs/pdf/0011/0011047.pdf

"The dance steps. One good way to implement algorithm X is to represent
each 1 in the

matrix A as a data object x with five fields L[x],R[x], U[x],D[x],C[x].
Rows of the matrix

are doubly linked as circular lists via the L and R fields ("left" and
"right"); columns are

doubly linked as circular lists via the U and D fields ("up" and
"down"). Each column

list also includes a special data object called its list header.

The list headers are part of a larger object called a column object.
Each column object

y contains the fields L[y],R[y], U[y],D[y], and C[y] of a data object
and two additional

fields, S[y] ("size") and N[y] ("name"); the size is the number of 1s in
the column, and the

name is a symbolic identifier for printing the answers. The C field of
each object points

to the column object at the head of the relevant column.

The L and R fields of the list headers link together all columns that
still need to be

covered. This circular list also includes a special column object called
the root, h, which

serves as a master header for all the active headers. The fields
U[h],D[h],C[h], S[h], and

N[h] are not used.

For example, the 0-1 matrix of (3) would be represented by the objects
shown in

Figure 2, if we name the columns A, B, C, D, E, F, and G. (This diagram
"wraps around"

toroidally at the top, bottom, left, and right. The C links are not
shown because they

would clutter up the picture; each C field points to the topmost element
in its column.)

Our nondeterministic algorithm to find all exact covers can now be cast
in the following

explicit, deterministic form as a recursive procedure search(k), which
is invoked initially

with k = 0:

If R[h] = h, print the current solution (see below) and return.

Otherwise choose a column object c (see below).

Cover column c (see below).

For each r ? D[c], DD[c], . . . , while r 6= c,

set Ok ? r;

for each j ? R[r], RR[r], . . . , while j 6= r,

cover column j (see below);

search(k + 1);

set r ? Ok and c ? C[r];

for each j ? L[r], LL[r], . . . , while j 6= r,

uncover column j (see below).

Uncover column c (see below) and return.

The operation of printing the current solution is easy: We successively
print the rows

containing O0, O1, . . . , Ok?1, where the row containing data object O
is printed by

printing NC[O], NC[R[O]], NC[R[R[O]]], etc."
--
Mabden
Nov 15 '05 #5

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

Similar topics

42
by: Bicho Verde | last post by:
I have now free time and money to do what I want :-) I have some basic skills in programming (C, Pascal, Macromedia Actionscript) but don't know exactly what to do in the world of programming. And...
15
by: Charles | last post by:
Hi folks, I would like to create an email client and organizer like MS Outlook, and I would give myself a year to do this, in the evening & week-ends. I have been looking for information on how...
11
by: robbiebell22 | last post by:
I have been looking all over the internet on how to learn C# .net. I have read a couple of books, lots of forums, and tutorials, but i am still at a very big loss as far as trying to write my own...
85
by: abhi | last post by:
hi everybody am new to this group and help me to learn C
6
by: TB | last post by:
Hi Everyone on comp.lang.c++: I am thinking about learning a programming language and I want to decide whether it is worthwhile spending my time learning the C++ programming language. I am a...
34
by: pandit | last post by:
hai all, i want to become a good programmer. one of my friends ( named "arnuld", he posts here infrequently), taught me Lisp. so i am not a programming beginner. i have heard these 2 points....
9
by: Katie Tam | last post by:
I am new to this filed and begin to learn this langague. Can you tell me the good books to start with ? Katie Tam Network administrator http://www.linkwaves.com/main.asp...
65
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective...
1
by: nembo kid | last post by:
I need of your advice. A good link where I can learn linked lists with recursive method (reverse, merge, sort, insertion and so on); well commented and explained.
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.