When using Ternary Content Addressable Memory (TCAM) inside routers it's used for faster address lookup that enables fast routing. In switches Content Addressable Memory (CAM) is used for building and lookup of mac address table that enables L2 forwarding decisions. Besides Longest-Prefix Matching, TCAM in today's routers and multilayer Switch devices are used to store ACL, QoS and other things from upper-layer processing.