\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Recitation 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We talked about binary numbers (with some theory) and base conversions. We have also impletemented an algorithm for base conversion, examined python's memory model and discussed in-place functions. Finally, we have (or will next week) analyzed the efficiency of using extend() vs. creating a new list with another element. \n",
"\n",
"#### Takeaways:\n",
"\n",
"\n",
"
Make sure you understand binary numbers and base conversions (including the algorithms for convertion to and from a base b to decimal). It is a very useful tool in computer science
\n",
"
Elements of a global list can be changed from inside a function, if this list is given as a parameter, but the variable name (whether it be the list name or the int name etc.) itself cannot be made to point to a different object in the memory when passed as a function parameter.
\n",
"
Whenever you are not clear of what your program is doing in memory, use [Python tutor](http:\\\\www.pythontutor.com).
\n",
"
If you want to change a list, in-place functions such as append(), extend() and += are more efficient than creating a new list.
\n",
"
Try to analyze the number of operations your function does to see how will its runtime scale as a function of the input (we will elabore on this soon).
\n",
"\n",
"\n",
"#### Python tutor guidelines:\n",
"Before you click \"Visualize Execution\" button, you may want to use the following settings (can be adjusted via the drop boxes next to the textbox):\n",
"\n",
"