Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 20-10-2008
Member
 
Join Date: Oct 2008
Posts: 89
How to sort & search a single linklist?

Hello,

I am newbie to programming concept, now i am currently working with the LinkList, i am familiar with how the link list work but i wanted to know how reverse link list work and which is the best possible way to do it?

thanks
Reply With Quote
  #2  
Old 20-10-2008
Member
 
Join Date: Apr 2008
Posts: 193
The most efficient way to reverse a linked list is thorough recursion.
Exa on
void rev(struct node *list)
{
if (list->next==NULL)return;
rev(list->next);
printf(?%d?,list->info);
}

you could also have a good tutorial on the follwing link:
http://www.inversereality.org/tutori...nkedlists.html
Reply With Quote
  #3  
Old 20-10-2008
Member
 
Join Date: Mar 2008
Posts: 349
Searching a linked list is a very easy concept, just traverse each node till the next node pointer value is NULL and see if the value in the node matched the one we have to search or not.

Sorting a linked list can be a bit complicated though, we can use bubble sort, radic sort and heap sort technique and swap values using functions.

Even though all this sort are conceptually easy to understand but at the same time they are bit confusing while implementing.

cheers
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to sort & search a single linklist?"
Thread Thread Starter Forum Replies Last Post
Sort and search your emails with OutlookDeck SoftwareGuy Tips & Tweaks 1 03-06-2011 04:24 AM
How can I search for all files in windows vista by a word or phrase in the standard XP search box? Shazid Operating Systems 4 05-04-2011 04:29 AM
What is the difference between binary tree sort and heap sort in data structure sRIPRIYA Software Development 3 04-01-2011 01:25 AM
How to use Bubble sort in C# to sort parallel arraylists Ground 0 Software Development 3 03-08-2009 12:12 PM
Search Wikipedia, Google or Yahoo from Instant Search Box in Windows Vista akbar Tips & Tweaks 1 19-03-2009 05:55 PM


All times are GMT +5.5. The time now is 01:51 AM.