The Queen of Hearts was a female character created by Lewis Carroll in the 19th century. She appeared in his novel Alice's Adventures in Wonderland. She was the ruler of Wonderland and known for uttering the phrase, "Off with his head!"
In 2152, Hoshi Sato was familiar with the Queen of Hearts. At one point, in frustration for not figuring out a complex translation, she shuffled a deck of playing cards and drew herself a poker hand. When she saw the queen of hearts, she thought to herself dejectedly, "Off with my head." (ENT - Strange New Worlds 10 short story: "You Are Not in Space")
In 2269 on the Amusement Park planet, a trans-droid of the Queen of Hearts was built by the planet's Master Computer. The character ordered her subordinates The Playing Cards to kill Leonard McCoy by yelling, "Off with his head!" (TAS episode & Log Three novelization: Once Upon a Planet)
The phrase stuck with McCoy. In 2270, during a trial of Harry Mudd, as the verdict was being considered, James T. Kirk asked Spock how he might decide the case. McCoy's solution was the Queen of Hearts' catchphrase. (TOS - Mudd's Angels short story: "The Business, As Usual, During Altercations")
In 2276, when McCoy later found himself on trial by Romulans, it occurred to him that they might yell "Off with his head!" and feared the judge was capable and willing. (TOS - Rihannsu novel: The Romulan Way)
In 2373, Harry Kim recalled that the Queen of Hearts, the Mad Hatter, The Dormouse, and large caterpillars sitting on mushrooms were characters from Alice in Wonderland. He also remembered the phrase "Off with his head!" (VOY novel: Marooned)
- In her acknowledgments for TOS - The Yesterday Saga novel: Yesterday's Son, author A.C. Crispin described one of her proofers as someone who excised irrelevant details with the phrase "Off with its head!"
- TOS - Rihannsu novel: The Romulan Way
- TOS - Mudd's Angels short story: "The Business, As Usual, During Altercations"
- VOY novel: Marooned
- ENT - Strange New Worlds 10 short story: "You Are Not in Space"