```python
from typing import (
List,
)
from lintcode import (
TreeNode,
)
from collections import deque,defaultdict
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@param root: the root of tree
@return: the vertical order traversal
"""
def vertical_order(self, root: TreeNode) -> List[List[int]]:
# write your code here
q = deque()
res = defaultdict(list)
q.append((root,0))
while q:
node, col = q.popleft()
if node:
res[col].append(node.val)
q.append((node.left, col-1))
q.append((node.right, col+1))
return [res[i] for i in sorted(res)]
```