summaryrefslogtreecommitdiff
path: root/Schaum's_Outlines_-_Programming_with_C++/ch6.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Schaum's_Outlines_-_Programming_with_C++/ch6.ipynb')
-rw-r--r--Schaum's_Outlines_-_Programming_with_C++/ch6.ipynb15
1 files changed, 7 insertions, 8 deletions
diff --git a/Schaum's_Outlines_-_Programming_with_C++/ch6.ipynb b/Schaum's_Outlines_-_Programming_with_C++/ch6.ipynb
index 191b1c78..0ed8b9bb 100644
--- a/Schaum's_Outlines_-_Programming_with_C++/ch6.ipynb
+++ b/Schaum's_Outlines_-_Programming_with_C++/ch6.ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
- "signature": "sha256:002670bb2c70e6ed5cc1d52c3936c4a90e901b6c8d78abcf5af4402c27118a1a"
+ "signature": "sha256:d63f30088951026ca8431b2db000283f5d2b32b8fd4852f840cfd94c7913a4ff"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -45,7 +45,7 @@
"\n",
"SIZE=5 # defines the size N for 5 elements\n",
"a = []\n",
- "# declares the array's elements as type double\n",
+ "\n",
"print \"Enter \" , SIZE , \" numbers:\\t\"\n",
"for i in range(SIZE):\n",
" a.append(float(raw_input()))\n",
@@ -186,7 +186,7 @@
"import numpy\n",
"SIZE = 4\n",
"a = numpy.zeros(4)\n",
- "# declares the array's elements as type float\n",
+ "\n",
"for i in range(SIZE):\n",
" print \"\\ta[\" , i , \"] = \" , a[i]\n"
],
@@ -479,7 +479,7 @@
"input": [
"\n",
"def sort(a,n):\n",
- " # bubble sort:\n",
+ " \n",
" n = len(a)\n",
" for i in range(n):\n",
" # bubble up max{a[0..n-i]}:\n",
@@ -519,8 +519,7 @@
"\n",
"\n",
"def index(x,a,n):\n",
- " # PRECONDITION: a[0] <= a[1] <= ... <= a[n-1];\n",
- " # binary search:\n",
+ " \n",
" lo=0\n",
" hi=n-1\n",
" while (lo <= hi):\n",
@@ -559,7 +558,7 @@
"\n",
"\n",
"def isNondecreasing(a,n):\n",
- " # returns true iff a[0] <= a[1] <= ... <= a[n-1]:\n",
+ " \n",
" for i in range(1,n):\n",
" if (a[i]<a[i-1]):\n",
" return False\n",
@@ -590,7 +589,7 @@
"\n",
"\n",
"def isNondecreasing(a,n):\n",
- " # returns true iff a[0] <= a[1] <= ... <= a[n-1]:\n",
+ " \n",
" for i in range(1,n):\n",
" if (a[i]<a[i-1]):\n",
" return False\n",