Consider the following extension to the tree-locking protocol, which allows both shared and exclusive locks:
$•$ A transaction can be either a read-only transaction, in which case it can request only shared locks, or an update transaction, in which case it can request only exclusive locks.
$•$ Each transaction must follow the rules of the tree protocol. Read-only transactions may lock any data item first, whereas update transactions must lock the root first.
Show that the protocol ensures serializability and deadlock freedom.