You probably have the following setup:
\documentclass{report}
\usepackage{algorithm}
\renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}
\begin{document}
\setcounter{chapter}{2}% Just for this example
\chapter{Third chapter}
\begin{algorithm}
\caption{First algorithm}% 3.1
\end{algorithm}
\begin{algorithm}
\caption{Second algorithm}% 3.2
\end{algorithm}
\chapter{Fourth chapter}
\begin{algorithm}
\caption{Third algorithm}% 4.3
\end{algorithm}
\begin{algorithm}
\caption{Fourth algorithm}% 4.4
\end{algorithm}
\end{document}
The above reproduces your problem - only adding the chapter counter representation to your setup without making it reset with every new \chapter. This is the default behaviour of algorithm - providing continuous numbering of algorithms throughout the document, since there's not that many algorithms in any document in general.
To change this, you can either use chngcnt or amsmath together with
\usepackage{chngcntr}% also works with \usepackage{amsmath}
\counterwithin{algorithm}{chapter}
and remove the \renewcommand{\thealgorithm}. For more information, see Continuous v. per-chapter/section numbering of figures, tables, and other document elements.