Link to home
Start Free TrialLog in
Avatar of eddyhalim
eddyhalim

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of salikova
salikova

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ufolk123
ufolk123

>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.




Avatar of eddyhalim

ASKER

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

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