summaryrefslogtreecommitdiff
path: root/1034/CH1/EX1.12/example12.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1034/CH1/EX1.12/example12.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1034/CH1/EX1.12/example12.sce')
-rwxr-xr-x1034/CH1/EX1.12/example12.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/1034/CH1/EX1.12/example12.sce b/1034/CH1/EX1.12/example12.sce
new file mode 100755
index 000000000..80b29a827
--- /dev/null
+++ b/1034/CH1/EX1.12/example12.sce
@@ -0,0 +1,14 @@
+clear;
+clc;
+printf("Example 1.12");
+//[BIG "oh"]f(n)=O(g(n)). (big oh notation).
+printf("\n \n 3n+2=O(n) as 3n+2<=4n for all n>=2.");
+printf("\n \n 3n+3=O(n) as 3n+3<=4n for all n>=3.");............// O(n) is called linear.
+printf("\n \n 3n+2=O(n) as 100n+6<=101n for all n>=10.");
+printf("\n \n 10n^2+4n+2=O(n^2) as 10n^2+4n+2<=11n^2 for n>=5.");..........//O(n^2) is called quadratic.
+printf("\n \n 1000n^2+100n-6=O(n^2) as 1000n^2+100n-6<=1001n^2 for n>=100.");
+printf("\n \n 6*2^n+n^2<=7*2^n for n>=4");
+printf("\n \n 3n+3=O(n^2) as 3n+3<=3n^2 for n>=2");
+printf("\n \n 10n^2+4n+2=O(n^4) as 10n^2+4n+2<=10n^4 for n>=2.");
+printf("\n \n 3n+2 is not O(1) as 3n+2 is less than or equal to c for any constant c and all n,n>=n0.");............// O(1) means computing time is constant.
+printf("\n \n 10n^2+4n+2 is not O(n)");