Solved

Link list ascending

Posted on 2000-03-21
3
303 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
DCT of  2D array using fftw in c++ 9 97
How do i run a c++ file? 15 52
FMX TEdit KeyUp handler detecting  "enter" key 4 41
Need some help with design 17 22
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

726 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