The only person who can tell you if exercising your knee would be a good idea is your own doctor. So much depends on the type of injury you had, the type of surgery you had and the wear and tear that your knee has undergone since the surgery.
That being said, there are general knee exercises that can be done with healthy knees and on problem knees if your doctor has given the ok. They include:
Maintaining a good range of motion by using the knee regularly, keeping it moving naturally
Keeping your leg muscles strong and protecting the knee by walking, climbing stairs, or doing exercises that strengthen the leg muscles.
Before doing any type of exercise that may put stress on your knee, please speak with your doctor.