Interview Questions

Perform Sorted Insert on a link list and write test cases

Software QA/Tests Interview Questions from Microsoft


(Continued from previous question...)

Perform Sorted Insert on a link list and write test cases

Question:
Perform Sorted Insert on a link list and write test cases


maybe an answer:


Need to check these cases:
Case 1. An inserted node is the first one to be added to an empty list.
Case 2. The inserted node’s key is less than those of all others in the list; thus, the node goes at the beginning of a nonempty list.
Case 3. The key is greater than all the others; thus, the node goes at the end of the list.
Case 4. The key lies between two others; thus, the node goes in the middle of the list somewhere.

(Continued on next question...)

Other Interview Questions