Solved

Link list ascending

Posted on 2000-03-21
3
283 Views
Last Modified: 2012-05-04
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
Comment
Question by:eddyhalim
3 Comments
 

Accepted Solution

by:
salikova earned 30 total points
ID: 2643283
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
 
LVL 3

Expert Comment

by:ufolk123
ID: 2643313
>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
 

Author Comment

by:eddyhalim
ID: 2660060
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now