Singing in the Shrouds, by Ngaio Marsh

A serial killer has been fascinating and terrifying London. Dubbed the
“Flower Killer” by the press, he strangles women, drops flowers on their
bodies, and walks away singing. The final victim is found on the London docks
just as the freighter Cape Farewell pulls away; the freighter is
carrying eight passengers. The victim had a torn piece of embarkation
notice for the Cape Farewell in her hand. The inference is clear;
the Flower Killer might be on board the ship. There isn’t enough
evidence to call the Cape Farewell back to port, but plenty enough
to be worried, and so Inspector Alleyn boards the freighter at
Southhampton as “Mr. Broderick”, an official of the shipping line.

What follows is an interesting variant of the snowbound country house
mystery. The passengers are trapped on board the ship with a demented
killer, and only Alleyn and the ship’s captain are aware of it. Without
alarming the passengers, Alleyn must determine who the killer is, and
prevent him from killing again.

As a mystery it’s enjoyable enough, but Alleyn’s reflections on serial
killing and serial killers are dated, and the psychological
explanation for why the killer kills is ridiculously facile. But hey, it
was 1958.