Design an algorithm to figure out if someone has won a game of tic-tac-toe.
public class BiNode {
public BiNode node1, node2;
public int data;
}
Implement a method to convert a binary search tree into a doubly linked list (both implemented with BiNode
).
The values should be kept in order and the operation should be performed in place.