All mushrooms are mostly free living fungi but in lichens, fungi forms mutual association with algae. Fungi in mushrooms can belongs to either phylum Ascomycota or Basidiomycota. But fungi in lichens maximally (around 98%) belongs to phylum Ascomycota.