• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

Link list ascending

how could i make an ascending order using link list?
how could i compare a number such as number 9832331276(store in string) to another one.
1 Solution
strcmp() or strncmp() compares two strings byte-by-byte, according to the ordering  of  your  machine's  character  set.  

I wrote program set for doubly linked list and
for ring buffers.
I can send this codes to you. please
report your email ( my salikova@inp.nsk.su)

Knuth wrote very good books,  there is describes
algorithms for  linked lists.
>how could i make an ascending order >using link list?

>how could i compare a number such as >number 9832331276(store in string) to >another one.

It is easy if you are storing all data
in form
int length;
char* string;
In each node of list then strcmp function will help you ( It will work as ascii value of 2>1 etc ).
If numbers stored are in some range ( can be represented using double data type etc) then you can store them as doubles /ints instead of string all use number comparisons during node addition.

eddyhalimAuthor Commented:
if i'm using the double how to display all the number without the E(sign

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now