Click here to Skip to main content
15,905,686 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
Hi I want create some lines in C# and compare their heights, then sort them according to their heights?
Is it possible?
please help me

[Edit]OP's solution moved to his question

I want to analyze 4 sorting algorithms in graphic mode, I mean I have some lines, and these 4 sorting algorithms sort them in multithread mode and show which one is faster
[/Edit]

UPDATE from OP:
I need something like this:
http://www.4shared.com/file/23XuRzWr/2011-05-25_6-04-38_PM.html[^]
this is a film about what I need
Posted
Updated 25-May-11 4:03am
v3
Comments
Apfelmuuus 25-May-11 9:21am    
Yes it is! But how do you want to create them? If you can answer this you have to ask how to get their height... than look for some algorithms to sort things like "quick-sort" or something else.
Apfelmuuus 25-May-11 9:27am    
Here is something about sorting msdn
Member 7904482 25-May-11 10:52am    
I need something like this:
http://www.4shared.com/file/23XuRzWr/2011-05-25_6-04-38_PM.html
this is a film about what I need
Sergey Alexandrovich Kryukov 25-May-11 9:21am    
What do you mean by lines? Why doing it?
Graphics? Then tag is: WPF, Forms, what?
--SA
Sergey Alexandrovich Kryukov 25-May-11 9:22am    
I answered. Not clear what help do you need.
--SA

Yes.

(I'm adding this because the content is too short, but I don't want to add anything to the answer; see my comments to the question.)

—SA
 
Share this answer
 
Simplest way would be to draw vertical lines only. This can be done using Graphics.DrawLine method in the Paint event of the form. Do not create Graphics object. Use e.Graphics instead.

Then, you need to track the endpoints and length of the line segments in a Collection or a Dictionary.

Use your sorting algorithms on the lengths and then redraw all the lines sorted ascending or descending.

Note: I did not saw the video. Your filename has extension exe which seems weird for a video.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900