"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Recitation 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We discussed the basics of lists, the efficiency of list operations and how to efficiently concatenate a list to another. We also demonstrated list comprehension. \n",
"Then, we discussed functions, short circuit evaluation and analyzed the efficiency of the functions we saw.\n",
"Finally, we talked about binary numbers (with some theory) and base conversions.\n",
"\n",
"#### Takeaways:\n",
"\n",
"\n",
"
Lists can be a highly modular and useful data structure. Make sure that you understand their functionality and also their limits (figuratively and literally).
\n",
"
Avoid using the + operator for extending a given list. Use += or list.extend() instead.\n",
"
Functions can be used in one another (max2 in max3_v2) and can be composed together.
\n",
"
When analyzing a function's performance, think about the input that will cause the largest amount of work and then measure how many operations the function does.
\n",
"
Using short circuit evaluation, if e.g. you have a long \"and\" condition, place the part that is most easy to compute first since if it is false, all other parts of the condition will not be computed.
\n",
"
Make sure you understand binary numbers and base conversions (including the algorithms for conversion to and from a base b to decimal). It is a very useful tool in computer science.\n",
"