What are some hints for inserting a node into a linked list in C?

  • Thread starter Thread starter rambo3131
  • Start date Start date
  • Tags Tags
    List
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
rambo3131
Messages
18
Reaction score
0
hi ,i have a problem about c.i should write a function that struct node *insert(struct node root,int n) .This function should create a node and then place it in list (whose head pointer is root )for n th node .Please give me some hints ..
 
Physics news on Phys.org
Hint: At least do a Google search before asking something answered exhaustively in wikipedia.

There's pseudocode and just about everything you'd ever want to know about linked lists here:

http://en.wikipedia.org/wiki/Linked_list