Write test cases for printing Single Linked List and Double Linked List ?

Questions by vtpraveen

Editorial / Best Answer

kurtz182  

  • Member Since Nov-2009 | Dec 31st, 2009


SINGLY-LINKED LIST

Preconditions:
Node A points to node C ; [NODE A]---->[NODE C]
Node B is an insertion node;  Insert [NODE B]
 

Test cases:

TC1) You can insert [NODE B] after [NODE A]
TC2) You can not insert [NODE B] before [NODE A]
TC3) [NODE A] points to [NODE B] after insertion
TC4) [NODE B] points to [NODE C] after insertion
TC5) You can remove [NODE B]
TC6) [NODE A] points to [NODE C] after removal

DOUBLY-LINKED LIST

Preconditions:
Nodes A and C point to one another; [NODE A]<---->[NODE C]
Node B is an insertion node;   Insert [NODE B]
 

Test cases:

TC1) You can insert [NODE B] after [NODE A]
TC2) You can insert [NODE B] before [NODE A]
TC3) [NODE A] and [NODE B] point to one another after insertion
TC4) [NODE B] and [NODE C] point to one another after insertion
TC5) You can remove [NODE B]
TC6) [NODE A] and [NODE C] point to one another after removal


Showing Answers 1 - 0 of 0 Answers

SINGLY-LINKED LIST

Preconditions:
Node A points to node C ; [NODE A]---->[NODE C]
Node B is an insertion node;  Insert [NODE B]
 

Test cases:

TC1) You can insert [NODE B] after [NODE A]
TC2) You can not insert [NODE B] before [NODE A]
TC3) [NODE A] points to [NODE B] after insertion
TC4) [NODE B] points to [NODE C] after insertion
TC5) You can remove [NODE B]
TC6) [NODE A] points to [NODE C] after removal

DOUBLY-LINKED LIST

Preconditions:
Nodes A and C point to one another; [NODE A]<---->[NODE C]
Node B is an insertion node;   Insert [NODE B]
 

Test cases:

TC1) You can insert [NODE B] after [NODE A]
TC2) You can insert [NODE B] before [NODE A]
TC3) [NODE A] and [NODE B] point to one another after insertion
TC4) [NODE B] and [NODE C] point to one another after insertion
TC5) You can remove [NODE B]
TC6) [NODE A] and [NODE C] point to one another after removal


Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions