Free Essay

Big O Notation

In: Computers and Technology

Submitted By emortalboy
Words 725
Pages 3
1

Big-Oh Notation Let f and g be functions from positive numbers to positive numbers. f (n) is O(g(n)) if there are positive constants C and k such that: f (n) ≤ C g(n) whenever n > k f (n) is O(g(n)) ≡ ∃C ∃k ∀n (n > k → f (n) ≤ C g(n)) To prove big-Oh, choose values for C and k and prove n > k implies f (n) ≤ C g(n). Standard Method to Prove Big-Oh 1. Choose k = 1. 2. Assuming n > 1, find/derive a C such that f (n) C g(n) ≤ =C g(n) g(n) This shows that n > 1 implies f (n) ≤ C g(n). Keep in mind: • n > 1 implies 1 < n, n < n2, n2 < n3, . . . • “Increase” numerator to “simplify” fraction.

2

Proving Big-Oh: Example 1 Show that f (n) = n2 + 2n + 1 is O(n2). Choose k = 1. Assuming n > 1, then f (n) n2 + 2n + 1 n2 + 2n2 + n2 = < =4 2 2 g(n) n n Choose C = 4. Note that 2n < 2n2 and 1 < n2. Thus, n2 + 2n + 1 is O(n2) because n2 + 2n + 1 ≤ 4n2 whenever n > 1. Proving Big-Oh: Example 2 Show that f (n) = 3n + 7 is O(n). Choose k = 1. Assuming n > 1, then f (n) 3n + 7 3n + 7n 10n = < = = 10 g(n) n n n Choose C = 10. Note that 7 < 7n. Thus, 3n + 7 is O(n) because 3n + 7 ≤ 10n whenever n > 1.

3

Proving Big-Oh: Example 3 Show that f (n) = (n + 1)3 is O(n3). Choose k = 1. Assuming n > 1, then f (n) (n + 1)3 (n + n)3 8n3 = < = 3 =8 3 3 g(n) n n n Choose C = 8. Note that n + 1 < n + n and (n+n)3 = (2n)3 = 8n3. Thus, (n+1)3 is O(n3) because (n + 1)3 ≤ 8n3 whenever n > 1. Proving Big-Oh: Example 4 Show that f (n) = Σ i is O(n2). i=1 n

Choose k = 1. Assuming n > 1, then f (n) Σn i Σn n n2 = i=1 ≤ i=1 = 2 = 1 g(n) n2 n2 n Choose C = 1. Note that i ≤ n because n is the upper limit. Thus, Σn i is O(n2) because i=1 n i ≤ n2 whenever n > 1. Σi=1

4

How to Show Not Big-Oh f (n) is not O(g(n)) ≡ ∀C ∀k ∃n (n > k ∧ f (n) > C g(n)) Need to prove for all values of C and k. C and k cannot be replaced with constants. Choose n based on C and k. Prove that this choice implies n > k ∧ f (n) > C g(n) Standard Method to Prove Not-Big-Oh: 1. Assume n > 1. 2. Show: f (n) h(n) g(n) ≥ = h(n) g(n) g(n) where h(n) is strictly increasing to ∞. 3. n > h−1(C) implies h(n) > C, which implies f (n) > C g(n). So choosing n > 1, n > k, and n > h−1(C) implies n > k ∧ f (n) > C g(n).

5

Proving Not Big-Oh: Example 1 Show that f (n) = n2 − 2n + 1 is not O(n). Assume n > 1, then f (n) n2 − 2n + 1 n2 − 2n = > =n−2 g(n) n n n > C + 2 implies n − 2 > C and f (n) > Cn. So choosing n > 1, n > k, and n > C + 2 implies n > k ∧ f (n) > Cn. • “Decrease” numerator to “simplify” fraction. Proving Not Big-Oh: Example 2 Show that f (n) = (n − 1)3 is not O(n2). Assume n > 1, then: n3 − 3n2 + 3n − 1 n3 − 3n2 − 1 f (n) = > 2 g(n) n n2 n3 − 3n2 − n2 =n−4 > 2 n n > C + 4 implies n − 4 > C and f (n) > Cn2. Choosing n > 1, n > k, and n > C + 4 implies n > k ∧ f (n) > Cn2.

6

Proving Not Big-Oh: Example 3 Show that f (n) = n2/2 is not O(n). Assume n > 1, then: n2/2 n2/2 − 1 n2/2 − n f (n) = > > g(n) n n n = n/2 − 1 n > 2C + 2 → n/2 − 1 > C and f (n) > Cn. Choosing n > 1, n > k, and n > 2C +2 implies n > k ∧ f (n) > C n.

Similar Documents

Free Essay

Test

...%LJ 2 QRWDWLRQ Big O notation (with a capital letter O, not a zero), also called Landau's symbol, is a symbolism used in complexity theory, computer science, and mathematics to describe the asymptotic behavior of functions. Basically, it tells you how fast a function grows or declines. Landau's symbol comes from the name of the German number theoretician Edmund Landau who invented the notation. The letter O is used because the rate of growth of a function is also called its order. For example, when analyzing some algorithm, one might find that the time (or the number of steps) it takes to complete a problem of size n is given by T(n) = 4 n2 - 2 n + 2. If we ignore constants (which makes sense because those depend on the particular hardware the program is run on) and slower growing terms, we could say "T(n) grows at the order of n2" and write:T(n) = O(n2). In mathematics, it is often important to get a handle on the error term of an approximation. For instance, people will write ex = 1 + x + x2 / 2 + O(x3) for x -> 0 to express the fact that the error is smaller in absolute value than some constant times x3 if x is close enough to 0. For the formal definition, suppose f(x) and g(x) are two functions defined on some subset of the real numbers. We write f(x) = O(g(x)) (or f(x) = O(g(x)) for x -> C such that |f(x)| to be more precise) if and only if there exist constants N and C |g(x)| for all x>N. Intuitively, this means that f does not grow......

Words: 2121 - Pages: 9

Free Essay

Data Structure

...DATA STRUCTURES ANALYSIS OF ALGORITHMS Definition:-           The method of solving a problem is known as an algorithm.It is a sequence of instructions that act on some input data to produce some output in a finite number of steps. Properties:- a) Input:An algorithm must receive some input data supplied externally. b)Output:An algorithm must produce atleast one output as the result. c)Finiteness:The algorithm must terminate after a finite number of steps. d)Definiteness:The steps to be performed in the algorithm must be clear and unambiguous. e)Effectiveness:One must be able to perform the steps in the algorithm without applying any intelligence.           All algorithms basically fall under two broad categories-Iterative and Recursive algorithms.           Iterative Algorithms typically use loops and conditional statements.           Recursive Algorithms use a divide and Conquer strategy. As per this,the recursive algorithm breaks down a large problem into small pieces and then applies the algorithm to each of these smal pieces. Determining which algorithm is efficient than the other involves analysis of algorithms. While analyzing,time required to execute it determined .’time’ represents the number of operations that are carried out while executing the algorithm.           While analyzing iterative algorithms we need to determine how many times the loop is executed. To analyze a recursive algorithm one needs to determine amount of work done for three......

Words: 2466 - Pages: 10

Free Essay

Data Structures

...Data Structures and Algorithms DSA Annotated Reference with Examples Granville Barne Luca Del Tongo Data Structures and Algorithms: Annotated Reference with Examples First Edition Copyright c Granville Barnett, and Luca Del Tongo 2008. This book is made exclusively available from DotNetSlackers (http://dotnetslackers.com/) the place for .NET articles, and news from some of the leading minds in the software industry. Contents 1 Introduction 1.1 What this book is, and what it isn’t . . . 1.2 Assumed knowledge . . . . . . . . . . . . 1.2.1 Big Oh notation . . . . . . . . . . 1.2.2 Imperative programming language 1.2.3 Object oriented concepts . . . . . 1.3 Pseudocode . . . . . . . . . . . . . . . . . 1.4 Tips for working through the examples . . 1.5 Book outline . . . . . . . . . . . . . . . . 1.6 Testing . . . . . . . . . . . . . . . . . . . 1.7 Where can I get the code? . . . . . . . . . 1.8 Final messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 1 3 4 4 6 6 7 7 7 I Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . reverse order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

Words: 23014 - Pages: 93

Free Essay

Flow Shop Scheduling Problem

...A Comparison of Solution Procedures for the Flow Shop Scheduling Problem with Late Work Criterion Jacek Błażewicz *) Erwin Pesch 1) Małgorzata Sterna 2) Frank Werner 3) *) Institute of Computing Science, Poznań University of Technology Piotrowo 3A, 60-965 Poznań, Poland phone: +48 (61) 8790 790 fax: +48 (61) 8771 525 blazewic@sol.put.poznan.pl Institute of Information Systems, FB 5 - Faculty of Economics, University of Siegen Hölderlinstrasse 3, 57068 Siegen, Germany pesch@fb5.uni-siegen.de Institute of Computing Science, Poznań University of Technology Piotrowo 3A, 60-965 Poznań, Poland Malgorzata.Sterna@cs.put.poznan.pl Faculty of Mathematics, Otto-von-Guericke-University PSF 4120, 39016 Magdeburg, Germany Frank.Werner@mathematik.uni-magdeburg.de 1) 2) 3) 1 A Comparison of Solution Procedures for the Flow Shop Scheduling Problem with Late Work Criterion Abstract In this paper, we analyze different solution procedures for the two-machine flow shop scheduling problem with a common due date and the weighted late work criterion, i.e. for problem F2 | dj = d | Yw, which is known to be binary NP-hard. In computational experiments, we compare the practical efficiency of a dynamic programming approach, an enumerative method and a heuristic list scheduling procedure. Test results show that each solution method has its advantages and none of them can be rejected from the consideration a priori. Keywords: flow shop, late work, dynamic programming,......

Words: 9053 - Pages: 37

Free Essay

Systems

...Component 01 - Computing Principles | AS-Level (H046) | A-Level (H446) | 1 The characteristics of contemporary processors, input, output and storage devices | Structure and function of the processor | The Arithmetic and Logic Unit (ALU), Control Unit and registers: Program Counter (PC), Accumulator (ACC), Memory Address Register (MAR), Memory Data Register (MDR), Current Instruction Register (CIR).Buses: data, address and control: How this relates to assembly language programs.The fetch-decode-execute cycle, including its effect on registers.The factors affecting the performance of the CPU, clock speed, number of cores, cache.Von Neumann, Harvard and contemporary processor architecture. | The use of pipelining in a processor to improve efficiency. | Types of processor | The differences between, and uses of, CISC and RISC processors.Multicore and parallel systems. | GPUs and their uses (including those not related to graphics). | Input, output and storage | How different input output and storage devices can be applied as a solution of different problems.The uses of magnetic, flash and optical storage devices.RAM and ROM.Virtual storage. | | 2 Software and software development | Operating systems | The need for, function and purpose of operating systems.Memory management (paging, segmentation and virtual memory).Interrupts, the role of interrupts and Interrupt Service Routines (ISR), role within the fetch decode execute cycle.Scheduling: round robin, first......

Words: 1302 - Pages: 6

Free Essay

Video Conference

...Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved. Brute Force A straightforward approach, usually based directly on the problem’s statement and definitions of the concepts involved Examples: 1. Computing an (a > 0, n a nonnegative integer) 2. Computing n! Multiplying two matrices 3. 4. Searching for a key of a given value in a list Brute Force Sorting What would be the most straightforward method for solving the sorting problem? Reasonable people may disagree on the answer. Selection Sort or Bubble Sort Brute-Force Sorting Algorithm Selection Sort :  Scan the array to find its smallest element and swap it with the first element.  Then, starting with the second element, scan the elements to the right of it to find the smallest among them and swap it with the second elements. Generally, on pass i (0  i  n-2), find the smallest element in A[i..n-1] and swap it with A[i]: A[0]  . . .  A[i-1] | A[i], . . . , A[min], . . ., A[n-1] in their final positions  Example: 7 3 2 5 Selection Sort : Example 1 ) |89 45 68 90 29 34 17 2 ) 17 | 45 68 90 29 34 89 3 ) 17 29 | 68 90 45 34 89 4 ) 17 29 34 | 90 45 68 89 5 ) 17 29 34 45 | 90 68 89 6 ) 17 29 34 45 68 | 90 89 7 ) 17 29 34 45 68 89 | 90 Analysis of Selection Sort Time efficiency: Space efficiency: Stability: Θ(n^2) Θ(1), so in place yes Bubble Sort     Compare adjacent elements of the list and exchange them if they......

Words: 1552 - Pages: 7

Free Essay

Hostel

...end; unsigned long long a = 1, b = 1; //prompt start = clock(); //start timer for(unsigned long long n = 3; n <= count; ++n) //calculated by iterative { unsigned long long fib = a + b; a = b; b = fib; if (n==count) cout<<"Fibonacci Number: "<<fib<<endl; } //end timer show Runtime end=clock(); double diff ((double)(end - start)); double time = diff / CLOCKS_PER_SEC; cout<<"Runtime ("<< count <<"th) : "<< time <<" seconds"<<endl; cout<<"------------------------------------------------------"<<endl; count = count *10; } system ("pause"); return 0; } 2. Analysis: n=3count1=count-3+1 T(n) =count-2 =O(count) =O(n) 3. Table n-th Fibonacci no. | Time 1(sec) | Time 2(sec) | Time 3(sec) | Average(sec) | 10 | 0.001 | 0.001 | 0.001 | 0.001 | 100 | 0.001 | 0.001 | 0.001 | 0.001 | 1’000 | 0.002 | 0.001 | 0.001 | 0.0013 | 10’000 | 0.003 | 0.002 | 0.001 | 0.0020 | 100’000 | 0.003 | 0.001 | 0.002 | 0.0020 | 1’000’000 | 0.007 | 0.006 | 0.007 | 0.0067 | 10’000’000 | 0.053 | 0.048 | 0.047 | 0.0493 | 100’000’000 | 0.483 | 0.454 | 0.475 | 0.4706 | 1’000’000’000 | 4.495 | 4.612 | 4.503 | 4.5367 | 10’000’000’000 | 44.401 | 45.114 | 44.984 | 44.833 | 4. Graph b. Recursive Fibonacci 1. Code: #include <iostream> #include <time.h> using...

Words: 4123 - Pages: 17

Premium Essay

Clump Sort

...2010 Fourth Asia International Conference on Mathematical/Analytical Modelling and Computer Simulation Clump Sort: A Stable Alternative To Heap Sort For Sorting Medical Data Visvasuresh Victor Govindaswamy Computer Science Texas A&M University-Texarkana Texarkana, USA lovebat814@yahoo.com Matthew Caudill Computer Science Texas A&M University-Texarkana Texarkana, USA Jeff Wilson Computer Science Texas A&M University-Texarkana Texarkana, USA Daniel Brower Computer Science Texas A&M University-Texarkana Texarkana, USA G. Balasekaran, FACSM Medical and Sports Science Nanyang Technology University Singapore Abstract—Sorting data sets are a thoroughly researched field. Several sorting algorithms have been introduced and these include Bubble, Insertion, Selection, Shell, Quick, Merge and Heap. In this paper, we present a novel sorting algorithm, named Clump Sort, to take advantage of ordered segments already present in medical data sets. It succeeds in sorting the medical data considerably better than all the sorts except when using totally non-clumped data. In this test using totally nonclumped data, Heap sort does only slightly better than Clump sort. However, Clump sort has the advantage of being a stable sort as the original order of equal elements is preserved whereas in Heap sort, it is not since it does not guarantee that equal elements will appear in their original order after sorting. As such, Clump Sort will have considerably better data cache......

Words: 1753 - Pages: 8

Free Essay

Doc, Docx, Pdf, Wps, Rtf, Odt

...INDEX s.no | Name of program | Page no. | Remarks | SORTING PROGRAMS | 1 | program of merge sort | | | 2 | program of quick sort | | | 3 | program of bubble sort | | | 4 | program of insertion sort | | | 5 | program of selection sort | | | SEARCHING PROGRAMS | 6 | program of binary search iterative method | | | 7 | Program of binary search by recursive method | | | MULTIPLICATION PROGRAMS | 8 | program to multiply two matrices using direct method | | | 9 | program to multiply two matrices using recursion | | | 10 | program to multiply two matrices using strassen's method | | | //program of merge sort #include<stdio.h> #include<conio.h> #define MAX 50 void mergeSort(int arr[],int low,int mid,int high); void partition(int arr[],int low,int high); int main() { int merge[MAX],i,n; clrscr(); printf("Enter the total number of elements: "); scanf("%d",&n); printf("Enter the elements which to be sort: "); for(i=0;i<n;i++) { scanf("%d",&merge[i]); } partition(merge,0,n-1); printf("After merge sorting elements are: "); for(i=0;i<n;i++) { printf("%d ",merge[i]); } getch(); } void partition(int arr[],int low,int high) { int mid; if(low<high) { mid=(low+high)/2; partition(arr,low,mid); partition(arr,mid+1,high); mergeSort(arr,low,mid,high); } } void mergeSort(int arr[],int low,int mid,int high) { int i,m,k,l,temp[MAX]; l=low; i=low; m=mid+1; ......

Words: 1948 - Pages: 8

Free Essay

Mrs Priscilla

...1. Algorithms A and B perform the same task. On input of size n, algorithm A executes 0.5n2 steps, and algorithm B executes 300n steps. Find the value of n above which algorithm B is more efficient. Show your work. 0.5n2 = 300n => n2 = 600n =>n (n-600) = 0 Thus n = 0 => n – 600 = 0 =>n = 600 To test which one is most effective plug in 601 in both equations A = 0.5(601)2 = 0.5(361201) = 180600.5 B = 300(601) = 180300 Thus B is the most efficient 2. A long, long time ago, when I was in graduate school, I wrote a program to solve a difficult problem. The program had a time complexity of 2n(yeah, no kidding!). On input of size 50, my program finished in about an hour. How long would it have taken me to run my program on input of size 100? If input of 50 takes 1hr in a time complexity of 2n It also takes 1 hour to execute and input of 100 3. Write an All-Pairs algorithm that is given a list of numbers and a target and outputs each pair of values that sum to the target. The two algorithms can work Algorithm 1: 1) Initialize Binary Hash Map M[] = {0, 0, …} 2) Do following for each element A[i] in A[] (a)If M[x - A[i]] is set then print the pair (A[i], x – A[i]) (b)Set M[A[i]] Algorithm 2: 1) Sort the array in non-decreasing order. 2) Initialize two index variables to find the candidate elements in the sorted array. (a) Initialize first to the leftmost index: l = 0 ...

Words: 326 - Pages: 2

Premium Essay

Sort

...2010 Fourth Asia International Conference on Mathematical/Analytical Modelling and Computer Simulation Clump Sort: A Stable Alternative To Heap Sort For Sorting Medical Data Visvasuresh Victor Govindaswamy Matthew Caudill Jeff Wilson Computer Science Texas A&M University-Texarkana Texarkana, USA lovebat814@yahoo.com Computer Science Texas A&M University-Texarkana Texarkana, USA Computer Science Texas A&M University-Texarkana Texarkana, USA Daniel Brower G. Balasekaran, FACSM Computer Science Texas A&M University-Texarkana Texarkana, USA Medical and Sports Science Nanyang Technology University Singapore Abstract—Sorting data sets are a thoroughly researched field. Several sorting algorithms have been introduced and these include Bubble, Insertion, Selection, Shell, Quick, Merge and Heap. In this paper, we present a novel sorting algorithm, named Clump Sort, to take advantage of ordered segments already present in medical data sets. It succeeds in sorting the medical data considerably better than all the sorts except when using totally non-clumped data. In this test using totally nonclumped data, Heap sort does only slightly better than Clump sort. However, Clump sort has the advantage of being a stable sort as the original order of equal elements is preserved whereas in Heap sort, it is not since it does not guarantee that equal elements will appear in their original order after sorting. As such, Clump Sort will have considerably better data cache performance with......

Words: 1753 - Pages: 8

Premium Essay

It 265 Data Structures Phase 5

...IT 265 Data Structures for Problem Solving Data Structures and Methods 9/20/2014 Phase 5 Contents Executive Summary 4 Phase 1 4 Phase 2 4 Phase 3 4 Phase 4 4 Phase 5 5 Section 1: Lists, Stacks, and Queues 6 Stacks 6 Queues 10 Section 2: Hashing, Heaps and Trees 14 Section 3: Sorting Algorithms 20 Insertion sort 20 Bubble Sort 20 Selection sort 21 Section 4: Searching 22 Array 22 Linked Lists 23 Section 5: Recursion 30 References 33 Executive Summary Phase 1          A list is a collection of items in which the items have a position (Weiss, 2010).  A linked list allows data to be input or removed easily because each of the data items in the list is connected to its neighbor by a pointer that can be quickly and easily modified to accommodate new or removed items (CTU M.U.S.E. 2014). The Phase 1 portion of this document will be demonstrating the implementation of Stacks and Queues. Phase 2 Hash tables can be viewed as an array of lists and are used to speed up a search for data by creating a situation that does not require the search to start at the beginning and go through every item. The identifying value is the key and the associated record is the data, thus a hash table is a collection of (key, value) pairs. Phase 3 In order to efficiently use a database, the data must be stored in some sort of order. There are a number of different sorting algorithms; a programmer would choose which one to use depending on the......

Words: 3704 - Pages: 15

Free Essay

Blah

...LIST OF PRACTICALS OF C++ (CLASS XII) 1. WRITE MENU DRIVEN PROGRAM TO SHOW FOLLOWING OPERATIONS IN A 1-D ARRAY (USING USER DEFINED FUNCTION) MENU 1. CREATION OF AN ARRAY 2. SEARCHING ARRAY USING - 3. LINEAR SEARCH METHOD. BINARY SEARCH METHOD. SORTING ARRAY USING - SELECTION SORT - BUBBLE SORT - INSERTION SORT - MERGE SORT 4. INSERTING AN ELEMENT AT iTH POSITION 6. DELETING AN ELEMENT FROM AN ARRAY 7. 2. MERGE TWO ARRAYS OF INTEGERS IN ASCENDING OR DESCENDING ORDER 5. QUIT WRITE MENU DRIVEN PROGRAM TO SHOW FOLLOWING OPERATIONS IN A 2-D ARRAY (USING USER DEFINED FUNCTION) MENU 1. ADDING TWO 2-D ARRAYS 2. SUBSTRACTING TWO 2-D ARRAYS 3. MULTIPLYING TWO 2-D ARRAYS 4. CHECK WHETHER TWO 2-D ARRAYS ARE EQUIVALENT OR NOT 5. DISPLAY UPPER TRIANGULAR MATRIX 6. DISPLAY LOWER TRIANGULAR MATRIX 7. DISPLAY AND FIND SUM OF DIAGONAL ELEMENTS OF A 2-D ARRAY 8. DISPLAY AND FIND THE ROW-WISE SUM OF A 2-D ARRAY 9. DISPLAY AND FIND THE COLUMN-WISE SUM OF A 2-D ARRAY 10. QUIT 3. USING STRUCTURES WRITE A MENU DRIVEN PROGRAM TO ADD, SUBTRACT AND MULTIPLY AND DIVIDE TWO COMPLEX NUMBERS 4. USING STRUCTURES WAP TO CHECK THE VALIDY OF DATE 5. WRITE A PROGRAM TO DEFINE THE CLASS WORKER SHOWN BELOW CLASS WORKER ( PRIVATE : WNAME CHARACTER (20), WNO INTEGER, WGRATE FLOAT, HOURLYWAGERATE......

Words: 944 - Pages: 4

Free Essay

Software

...set of instructions that , if followed, accomplishes a particular task. 2. What are the characteristics of an algorithm?  Input – Zero or more quantities  Output – At least one quantity  Definiteness – each instruction is clear and unambiguous  Finiteness – terminate after a finite number of steps  Efficiency – easily understandable 3. Define Space Complexity The Space complexity of an algorithm is the amount of memory it needs to run to completion 4. Define Time Complexity Time complexity of an algorithm is the amount of computer time it needs to run to completion 5. What are asymptotic notations? The notations that enables us to make meaningful statements about the time and space complexity of a program is called asymptotic notations. 6. What are the various asymptotic notations used to define the efficiency of an algorithm?  Big ‘Oh’ (O)  Omega (Ω)  Theta (θ)  Little ‘oh’ (o)  Little Omega 7. What is information? Information is a recorded or communicated material that has some meaning associated with symbolic representation. 8. What are the aspects to be considered to ensure information transfer between source and destination?  Syntactic – Physical form of information  Semantic – Meaning  Pragmatic – Action taken as a result of interpretation of information 9. State the Markov algorithm It takes the input string X and through a number of steps in the algorithm, transform X to an output string Y 10. Differentiate function & procedure A function is a......

Words: 425 - Pages: 2

Free Essay

Ds Java

...Preliminaries 1 1 Data Structures and Algorithms 1.1 A Philosophy of Data Structures 1.1.1 The Need for Data Structures 1.1.2 Costs and Benefits 1.2 Abstract Data Types and Data Structures 1.3 Design Patterns 1.3.1 Flyweight 1.3.2 Visitor 1.3.3 Composite 1.3.4 Strategy 1.4 Problems, Algorithms, and Programs 1.5 Further Reading 1.6 Exercises 3 4 4 6 8 12 13 14 15 16 17 19 21 2 Mathematical Preliminaries 2.1 Sets and Relations 2.2 Miscellaneous Notation 2.3 Logarithms 2.4 Summations and Recurrences 25 25 29 31 33 iii iv Contents 2.5 2.6 2.7 2.8 2.9 3 II 4 Recursion Mathematical Proof Techniques 2.6.1 Direct Proof 2.6.2 Proof by Contradiction 2.6.3 Proof by Mathematical Induction Estimating Further Reading Exercises Algorithm Analysis 3.1 Introduction 3.2 Best, Worst, and Average Cases 3.3 A Faster Computer, or a Faster Algorithm? 3.4 Asymptotic Analysis 3.4.1 Upper Bounds 3.4.2 Lower Bounds 3.4.3 Θ Notation 3.4.4 Simplifying Rules 3.4.5 Classifying Functions 3.5 Calculating the Running Time for a Program 3.6 Analyzing Problems 3.7 Common Misunderstandings 3.8 Multiple Parameters 3.9 Space Bounds 3.10 Speeding Up Your Programs 3.11 Empirical Analysis 3.12 Further Reading 3.13 Exercises 3.14 Projects Fundamental Data Structures Lists, Stacks, and Queues 36 39 40 40 41 47 49 50 57 57 63...

Words: 30587 - Pages: 123