An algorithm using depth-first search (DFS) can check if a graph is bipartite by partitioning the vertices into two sets X and Y such that every edge connects a vertex in X to one in Y. The DFS algorithm assigns vertices to X or Y based on the color of the previously visited vertex and checks for conflicting edges that connect vertices of the same color, determining if the graph is bipartite.