Cisco interview question

explain ospf algorithm and bgp?