The output of bfs

sir you forgot to enter the relation (0,3) that’s why the output is different

@siddharthmishra11s thanks for the input!