Explain the term diode with its working. What are the types of diode? .Also, tell about its applications in general life.