How a sender will ensure that the public key used for encryption is the key of intended reciver?
This is usually guaranteed by a Public Key Infrastructure (PKI). Typically a certificate authority (CA) signs and issues certificates that bind public keys with the associated entities' (e.g., Bob's) identity. A CA is a trusted third party such that everyone can verify the CA's signature on a certificate to see if it is valid or not. Such a verification algorithm (or the CA's public key associated with its signing secret key) has already been distributed to Alice and any other users who trust the CA (e.g., pre-installed on a laptop).