Answer
(a) $2\pi \sqrt{\frac{L}{g+a}}$
(b) $2\pi \sqrt{\frac{L}{g-a}}$
Work Step by Step
(a) We know that if the elevator accelerates upward then its gravitational acceleration is $g+a$ and the time period of simple pendulum is given as
$T=2\pi \sqrt{\frac{L}{g+a}}$
(b) If the elevator accelerates downward then the gravitational acceleration is $g-a$ and we can express time period of simple pendulum as
$T=2\pi \sqrt{\frac{L}{g-a}}$