Technical Interview

Home
Technical Interview
Interview Process
Introduction Questions
Quantitative Problems
Google & Microsoft
Algorithms
Object Oriented
C/C++ Questions
Java Questions
Data Structures
Fundamental Questions
Puzzles
Resume Tips
Added Recently
Links
Contact Us
Submit Question/Answer

 

What are the steps to inserting a new item at the head of a linked list? Use one short English sentence for each step.

 

Solutions:

 

Make a temporary IntNode variable called temp refer to a newly allocated node.  Fill in the data of the new node. Make the link field of the new node equal to the old head pointer. Make the head pointer refer to the new node.