"The Ultimate Computer" is the twenty-fourth episode of the second season of the American science fiction television series Star Trek. Written by D.C. Fontana (based on a story by Laurence N. Wolfe) and directed by John Meredyth Lucas, it was first broadcast on March 8, 1968. In the episode, the crew of the Enterprise race to disable a rogue computer in total control of the ship.