TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Muhammad Adeel
NA
55
14.1k
Sorting strings (C#).
Sep 10 2014 1:50 PM
The following code is working perfectly for int array but i want to sort array string without using any built in library such as array.sort or .compareTo. so what should i change.
int[] a = { 3, 2, 5, 4, 1 };
int t;
for (int p = 0; p <= a.Length - 2; p++)
{
for (int i = 0; i <= a.Length - 2; i++)
{
if (a[i] > a[i + 1])
{
t = a[i + 1];
a[i + 1] = a[i];
a[i] = t;
}
}
}
foreach (int aa in a)
Console.Write(aa + " ");
Reply
Answers (
12
)
Asp.net deploy
Question about class