Solved

Link list ascending

Posted on 2000-03-21
3
297 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

789 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