"Without further information, I have no reason to think that the scenario you described is illegal."
It depends on where and when you are. Traffic laws vary from place to place, and change over time.
According to wikipedia, u-turns are generally legal in Indiana and generally illegal in Oregon. https://en.wikipedia.org/wiki/U-turn
In Colorado, u-turns are subjectively legal under safe conditions. http://www.colorado.gov/cs/Satellite/Revenue-MV/RMV/12126578...
In Colorado, you will be fined and assessed costs and points for a subjectively illegal u-turn: http://www.denvertrafficlawyer.com/index.php/legal-services2...
I don't know what "points" means to a bicyclist, or one who has or doesn't have a driver license.