<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://cs1.utm.edu/icpc/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://cs1.utm.edu/icpc/feed.php">
        <title>UT Martin Competitive Programming Guidebook</title>
        <description></description>
        <link>http://cs1.utm.edu/icpc/</link>
        <image rdf:resource="http://cs1.utm.edu/icpc/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-05-03T00:34:34+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:priority_queue&amp;rev=1557265683&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:list_comprehensions&amp;rev=1557263952&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3&amp;rev=1557258720&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:recursion_depth&amp;rev=1557252646&amp;do=diff"/>
                <rdf:li rdf:resource="http://cs1.utm.edu/icpc/doku.php?id=python3:lru_cache&amp;rev=1557250994&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://cs1.utm.edu/icpc/lib/tpl/dokuwiki/images/favicon.ico">
        <title>UT Martin Competitive Programming Guidebook</title>
        <link>http://cs1.utm.edu/icpc/</link>
        <url>http://cs1.utm.edu/icpc/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:priority_queue&amp;rev=1557265683&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T16:48:03+00:00</dc:date>
        <dc:creator>jguerin (jguerin@undisclosed.example.com)</dc:creator>
        <title>python3:priority_queue</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:priority_queue&amp;rev=1557265683&amp;do=diff</link>
        <description>Python3 Priority Queues

Insertion &amp; Removal


import queue

q = queue.PriorityQueue()
q.put(10)
q.put(1)
q.put(5)
while not q.empty():
    print(q.get())    # 1 5 10


Modifying Priority

Unlike C++ and Java, the standard priority queue in Python3 does not take a comparator on declaration. There are two means of dealing with a modified priority or a priority that is separate from the object:</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:list_comprehensions&amp;rev=1557263952&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T16:19:12+00:00</dc:date>
        <dc:creator>jguerin (jguerin@undisclosed.example.com)</dc:creator>
        <title>python3:list_comprehensions - Moved the multiple loop example, switched x*2 to abs(x) in list example.</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:list_comprehensions&amp;rev=1557263952&amp;do=diff</link>
        <description>List Comprehensions

List comprehensions are used for creating lists from existing lists and other iterable structures. List comprehensions typically follow formatting similar to set-builder notation in discrete mathematics.

Syntax

Consider the following illustrative Python3 example for generating a list of squares:</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3&amp;rev=1557258720&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T14:52:00+00:00</dc:date>
        <dc:creator>jguerin (jguerin@undisclosed.example.com)</dc:creator>
        <title>python3</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3&amp;rev=1557258720&amp;do=diff</link>
        <description>1. Python Language Reference

Programming languages are a tool. While many modern programming languages are designed to be general purpose, some programming languages may be better suited to solve certain problems than others.

When to use Python3

While efficiency of a</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:recursion_depth&amp;rev=1557252646&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T13:10:46+00:00</dc:date>
        <dc:creator>jguerin (jguerin@undisclosed.example.com)</dc:creator>
        <title>python3:recursion_depth - Modified footnote to reference &quot;production&quot; rather than &quot;contests.&quot;</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:recursion_depth&amp;rev=1557252646&amp;do=diff</link>
        <description>Recursion Depth Limits

Factorial

The factorial function is a canonical recursive example. Factorial has a convenient recursive definition as n! = n * (n -- 1)! where 0! = 1! = 1.

The following is a standard implementation derived from this definition:


def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)

print(factorial(997))</description>
    </item>
    <item rdf:about="http://cs1.utm.edu/icpc/doku.php?id=python3:lru_cache&amp;rev=1557250994&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-05-07T12:43:14+00:00</dc:date>
        <dc:creator>jguerin (jguerin@undisclosed.example.com)</dc:creator>
        <title>python3:lru_cache</title>
        <link>http://cs1.utm.edu/icpc/doku.php?id=python3:lru_cache&amp;rev=1557250994&amp;do=diff</link>
        <description>LRU Cache

Memoization is a common optimization technique where repeatedly computed values are cached for quick lookup. While memoization can be achieved by a relatively simple modification to many recursive formulations, Python3's functools library implements automatic memoization in the form of an LRU (least recently used) cache as a</description>
    </item>
</rdf:RDF>
