Let the length and breadth of the rectangular garden be $x$ and $y$ meter, respectively.
Given:
$x y=180 \mathrm{sq} \mathrm{m}$$\ldots(i)$ and
$\begin{array}{l}
2 y+x=39 \\
\Rightarrow x=39-2 y
\end{array}$
Putting the value of $x$ in (i), we get:
$\begin{array}{l}
(39-2 y) y=180 \\
\Rightarrow 39-2 y^{2}=180 \\
\Rightarrow 39 y-2 y^{2}-180=0 \\
\Rightarrow 2 y^{2}-39 y+180=0 \\
\Rightarrow 2 y^{2}-(24+15) y+180=0 \\
\Rightarrow 2 y^{2}-24 y-15 y+180=0 \\
\Rightarrow 2 y(y-12)-15(y-12)=0 \\
\Rightarrow(y-12)(2 y-15)=0 \\
\Rightarrow y=12 \text { or } y=\frac{15}{2}=7.5
\end{array}$
If $y=12, x=39-24=15$
If $y=7.5, x=39-15=24$
Thus, the length and breadth of the garden are (15 m and $12 \mathrm{~m}$ ) or ( $24 \mathrm{~m}$ and $7.5 \mathrm{~m}$ ), respectively.