Sequential structure to tree structure for cache