Changed discussions of NULL to None to be more Pythonic.

This commit is contained in:
Donne Martin
2015-07-06 05:44:06 -04:00
parent 29685c7b35
commit 47e6a23dde
11 changed files with 55 additions and 55 deletions

View File

@@ -46,7 +46,7 @@
"source": [
"## Test Cases\n",
"\n",
"* NULL tower(s)\n",
"* None tower(s)\n",
"* 0 disks\n",
"* 1 disk\n",
"* 2 or more disks"
@@ -124,7 +124,7 @@
" buff = Stack()\n",
" dest = Stack()\n",
"\n",
" print('Test: NULL towers')\n",
" print('Test: None towers')\n",
" hanoi(num_disks, None, None, None)\n",
"\n",
" print('Test: 0 disks')\n",

View File

@@ -45,7 +45,7 @@
"source": [
"## Test Cases\n",
"\n",
"* NULL tower(s)\n",
"* None tower(s)\n",
"* 0 disks\n",
"* 1 disk\n",
"* 2 or more disks"
@@ -141,7 +141,7 @@
" buff = Stack()\n",
" dest = Stack()\n",
"\n",
" print('Test: NULL towers')\n",
" print('Test: None towers')\n",
" hanoi(num_disks, None, None, None)\n",
"\n",
" print('Test: 0 disks')\n",
@@ -181,7 +181,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Test: NULL towers\n",
"Test: None towers\n",
"Test: 0 disks\n",
"Test: 1 disk\n",
"Test: 2 or more disks\n",

View File

@@ -2,14 +2,14 @@ from nose.tools import assert_equal
class TestHanoi(object):
def test_hanoi(self):
num_disks = 3
src = Stack()
buff = Stack()
dest = Stack()
print('Test: NULL towers')
print('Test: None towers')
hanoi(num_disks, None, None, None)
print('Test: 0 disks')
@@ -33,6 +33,6 @@ class TestHanoi(object):
def main():
test = TestHanoi()
test.test_hanoi()
if __name__ == '__main__':
main()

View File

@@ -85,7 +85,7 @@
"\n",
"### Pop\n",
"\n",
"* If stack is empty, return NULL\n",
"* If stack is empty, return None\n",
"* Else \n",
" * Save top's value\n",
" * Set top to top.next\n",
@@ -97,7 +97,7 @@
"\n",
"### Peek\n",
"\n",
"* If stack is empty, return NULL\n",
"* If stack is empty, return None\n",
"* Else return top's value\n",
"\n",
"Complexity:\n",