We present an improved multileaf collimator (MLC) segmentation algorithm, denoted by SLS(NOTG) (static leaf sequencing with no tongue-and-groove error), for step-and-shoot intensity-modulated radiation therapy (IMRT) delivery. SLS(NOTG) is an improvement over the MLC segmentation algorithm called SLS that was developed by Luan et al. [Med. Phys. 31(4), 695-707 (2004)], which did not consider tongue-and-groove error corrections. The aims of SLS(NOTG) are (1) shortening the treatment times of IMRT plans by minimizing their numbers of segments and (2) minimizing the tongue-and-groove errors of the computed IMRT plans. The input to SLS(NOTG) is intensity maps (IMs) produced by current planning systems, and its output is (modified) optimized leaf sequences without tongue-and-groove error. Like the previous SLS algorithm [Luan et al., Med. Phys. 31(4), 695-707 (2004)], SLS(NOTG) is also based on graph algorithmic techniques in computer science. It models the MLC segmentation problem as a weighted minimum-cost path problem, where the weight of the path is the number of segments and the cost of the path is the amount of tongue-and-groove error. Our comparisons of SLS(NOTG) with CORVUS indicated that for the same intensity maps, the numbers of segments computed by SLS(NOTG) are up to 50% less than those by CORVUS 5.0 on the Elekta LINAC system. Our clinical verifications have shown that the dose distributions of the SLS(NOTG) plans do not have tongue-and-groove error and match those of the corresponding CORVUS plans, thus confirming the correctness of SLS(NOTG). Comparing with existing segmentation methods, SLS(NOTG) also has two additional advantages: (1) SLS(NOTG) can compute leaf sequences whose tongue-and-groove error is minimized subject to a constraint on the maximum allowed number of segments, which may be desirable in clinical situations where a treatment with the complete correction of tongue-and-groove error takes too much time, and (2) SLS(NOTG) can be used to minimize a more general type of error called the tongue-or-groove error.