As you can probably tell, Whitman wasn't the biggest fan of traditional forms. He was a fan of poetry that rambled and wandered as much as he did. As a result, most of his poems (including this one) are written in free verse, a form he practically invented. And when we say "form," we kind of mean anti-form. You see, free verse poems lack any set rhyme scheme or pattern of meter.
Just check out the following example, and notice how it rolls along the page with no clear rhyme or rhythm:
I perceive I have not really understood any thing, not a single object, and that no man ever can,
Nature here in sight of the sea taking advantage of me to dart upon me and sting me,
Because I have dared to open my mouth to sing at all. (33-35)
The lines flow naturally, adhering to no specific form. But that doesn't mean the poem is entirely free of poetic elements.
Whitman still separated the poem into lines and stanzas, and indicated to us how we were supposed to read them. One way he did that was by using end stops in the form of a comma or period.
As I wend to the shores I know not,
As I list to the dirge, the voices of men and women wreck'd, (18-19)
The comma is an end-stop, forcing us to take a breath before moving to the next line. It's one way to emphasize an image or phrase, and it's a great way to keep a poem from reading like one long paragraph.
So, Whitman's choice of form here is mean to mimic the actions of his speaker: roaming free, ambling here and there, but stopping at times in order to soak it all in, to reflect on his journey and what it's all about.