{
    "content": [
        {
            "type": "text",
            "text": "# _bisect (pydoc)\n\n**Summary:** bisect - Bisection algorithms.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (5 lines)\n- **FUNCTIONS** (1 lines) — 4 subsections\n  - bisect_left (9 lines)\n  - bisect_right (9 lines)\n  - insort_left (7 lines)\n  - insort_right (7 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nbisect - Bisection algorithms.\n\n### DESCRIPTION\n\nThis module provides support for maintaining a list in sorted order without\nhaving to sort the list after each insertion. For long lists of items with\nexpensive comparison operations, this can be an improvement over the more\ncommon approach.\n\n### FUNCTIONS\n\n#### bisect_left\n\nReturn the index where to insert item x in list a, assuming a is sorted.\n\nThe return value i is such that all e in a[:i] have e < x, and all e in\na[i:] have e >= x.  So if x already appears in the list, a.insert(i, x) will\ninsert just before the leftmost x already there.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n\n#### bisect_right\n\nReturn the index where to insert item x in list a, assuming a is sorted.\n\nThe return value i is such that all e in a[:i] have e <= x, and all e in\na[i:] have e > x.  So if x already appears in the list, a.insert(i, x) will\ninsert just after the rightmost x already there.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n\n#### insort_left\n\nInsert item x in list a, and keep it sorted assuming a is sorted.\n\nIf x is already in a, insert it to the left of the leftmost x.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n\n#### insort_right\n\nInsert item x in list a, and keep it sorted assuming a is sorted.\n\nIf x is already in a, insert it to the right of the rightmost x.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n\n### FILE\n\n(built-in)\n\n"
        }
    ],
    "structuredContent": {
        "command": "_bisect",
        "section": "",
        "mode": "pydoc",
        "summary": "bisect - Bisection algorithms.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "bisect_left",
                        "lines": 9
                    },
                    {
                        "name": "bisect_right",
                        "lines": 9
                    },
                    {
                        "name": "insort_left",
                        "lines": 7
                    },
                    {
                        "name": "insort_right",
                        "lines": 7
                    }
                ]
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}