The NCAA rulebook and a whole buncha good stuff--videos, etc. -- are online at
http://www.eofficials.com/
You have to register as an affiliate, but there is no cost.
The NFHS only sells hard copies of their rule books or charges a fee($30 I think) to read their rule book on line. They do post new rulings, interpretations, etc. though. Try this link and follow the prompts into basketball rules.
http://www.nfhs.org/