Assuming you're working flat and not in the round, yes, alternate knit rows with purl rows, even or odd number of rows doesn't matter. If your first row is a knit row, it will be 1 row knit, 1 row purl, 1 row knit; if the first is a purl row, it will be 1 row purl, 1 row knit, 1 row purl. The pattern writer will have taken this into consideration and the next row will be written appropriately.
If you're working in the round, all rows are knit for stockinette. I mention this because many hat patterns are worked in the round.
This is the last time I'm frogging this project for the last time.