• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • 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.
0
eddyhalim
Asked:
eddyhalim
1 Solution
 
salikovaCommented:
strcmp() or strncmp() compares two strings byte-by-byte, according to the ordering  of  your  machine's  character  set.  

LINK LIST:
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.
0
 
ufolk123Commented:
>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.




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

e.g:
1.395*E5
become
1.3950000.....
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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