A Swapping Red-black Tree for Wear-leveling of Non-volatile Memory