U.S. major stock indexes rallied on Tuesday, buoyed by rising tech shares.