Matching Markets Meet LLMs: Algorithmic Reasoning with Ranked Preferences