I play with my hair when I'm bored or thinking, regardless of who is sitting near me. Now if I was looking at/talking to you while doing it, then it might mean I like you. Its kinda hard to subtly flirt with a guy in class if he sits behind you. If you sit next to each other, at least the girl could look at you, smile, talk to you, touch your arm, etc.
I would shift my position to one that would draw attention to myself, and show off more than just the back of my head. (e.g. twist my body sideways in the chair, and cross my legs.) If he sat beside me, I would make eye contact, smile, etc. I might tug at my shirt to show off my shape better.
I sat next to this girl in my class tonight for a few minutes while I talked to someone I knew. She had looked at me a few times before (if she even meant anything by it) and all she did was play with her phone and turn herself to face slightly away from me lol