c - Sorting linked list average at end -


i have write function sorts list in specific way, have singly linked list of ints , have find average of numbers in list , put nodes above average @ end of list. can't create new list have work on given list. how can accomplish it?i have this?

  1. calculate average
  2. find node above average save data inside , delete
  3. malloc newnode , add data newnode , link end of list
  4. repeat?

is method right? somehow unlink given node , add @ end of list deleting , re-creating aren't needed?


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -