• Post Reply Bookmark Topic Watch Topic
  • New Topic

print in Lexicographic  RSS feed

 
Castulo Ruiz
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is code is suppose to search down the list using previous and current pointer.
and loop quits at the end of the list or when insertion point is found. if the word(key) is not already in the list, allocate a new node
and insert it in the correct position. If word is in the list do nothing.

My problem is that when it comes to printing it does not put them in the right order.
For Example: input is [1 3 2 5] The printing should be [1 2 3 5]. I might be messing up with the pointers, but not sure.


I read this article, but it did not help though. Maybe I just dont see it.
Ordered Insertion

 
Jonas Isberg
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What output do your program generate? (ItDoesntWorkIsUseless)

You might also improve the odds of getting help by making it
easier to read (indentations) and posting a complete running
example. (My brain is simply not awake enough to parse the code
on its own. )
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!