Cisco Interview Question

explain ospf algorithm and bgp?