A month before your knee surgery, gi to physical therapy one time & have them give you some exercises to do. You need to stretch muscles out, so that when they cramp up, they are still long enough to not have a Charlie horse that dont go away.
I tore my miniskus & had scope surgery. No physical therapy before. Had lots of pain after that. Didn't get me to where I wanted to be.
Scheduled knee replacement. Got physical therapy instructions a month ahead. Went to doc for physical 2 weeks before scheduled surgery. She told me to be doing the exercises on both legs. Surgery got postponed 2 weeks. I did my exercises 2 or ,3 times a week, at home.
I did laps in the hospital hallway after surgery. 2 weeks later went square dancing & did a couple tips. Month after surgery, went on vacation & climbed lots of stairs where we stayed & to the top of a Mayan ruin that was 200 ft tall.
Since, I know of 4 people who got knee's replaced, same surgeon, who didn't do exercises before surgery. They all were having problems walking like a city block, a month or 2 after their surgery.