14 Answers

Up Vote9Down Vote

Quick note, my answer is almost certainly confusing Big Oh notation (which is an upper bound) with Big Theta notation "Θ" (which is a two-side bound). But in my experience, this is actually typical of discussions in non-academic settings. Apologies for any confusion caused.


BigOh complexity can be visualized with this graph: The simplest definition I can give for Big Oh notation is this:

There are some important and deliberately chosen words in that sentence:


Come back and reread the above when you've read the rest. The best example of BigOh I can think of is doing arithmetic. Take two numbers (123456 and 789012). The basic arithmetic operations we learned in school were:


Each of these is an operation or a problem. A method of solving these is called an . The addition is the simplest. You line the numbers up (to the right) and add the digits in a column writing the last number of that addition in the result. The 'tens' part of that number is carried over to the next column. Let's assume that the addition of these numbers is the most expensive operation in this algorithm. It stands to reason that to add these two numbers together we have to add together 6 digits (and possibly carry a 7th). If we add two 100 digit numbers together we have to do 100 additions. If we add 10,000 digit numbers we have to do 10,000 additions. See the pattern? The (being the number of operations) is directly proportional to the number of digits in the larger number. We call this or . Subtraction is similar (except you may need to borrow instead of carry). Multiplication is different. You line the numbers up, take the first digit in the bottom number and multiply it in turn against each digit in the top number and so on through each digit. So to multiply our two 6 digit numbers we must do 36 multiplications. We may need to do as many as 10 or 11 column adds to get the end result too. If we have two 100-digit numbers we need to do 10,000 multiplications and 200 adds. For two one million digit numbers we need to do one trillion (10) multiplications and two million adds. As the algorithm scales with n-, this is or . This is a good time to introduce another important concept:

The astute may have realized that we could express the number of operations as: n + 2n. But as you saw from our example with two numbers of a million digits apiece, the second term (2n) becomes insignificant (accounting for 0.0002% of the total operations by that stage). One can notice that we've assumed the worst case scenario here. While multiplying 6 digit numbers, if one of them has 4 digits and the other one has 6 digits, then we only have 24 multiplications. Still, we calculate the worst case scenario for that 'n', i.e when both are 6 digit numbers. Hence Big Oh notation is about the Worst-case scenario of an algorithm.

The Telephone Book

The next best example I can think of is the telephone book, normally called the White Pages or similar but it varies from country to country. But I'm talking about the one that lists people by surname and then initials or first name, possibly address and then telephone numbers. Now if you were instructing a computer to look up the phone number for "John Smith" in a telephone book that contains 1,000,000 names, what would you do? Ignoring the fact that you could guess how far in the S's started (let's assume you can't), what would you do? A typical implementation might be to open up to the middle, take the 500,000 and compare it to "Smith". If it happens to be "Smith, John", we just got really lucky. Far more likely is that "John Smith" will be before or after that name. If it's after we then divide the last half of the phone book in half and repeat. If it's before then we divide the first half of the phone book in half and repeat. And so on. This is called a and is used every day in programming whether you realize it or not. So if you want to find a name in a phone book of a million names you can actually find any name by doing this at most 20 times. In comparing search algorithms we decide that this comparison is our 'n'.


That is staggeringly good, isn't it? In BigOh terms this is or . Now the logarithm in question could be ln (base e), log, log or some other base. It doesn't matter it's still O(log n) just like O(2n) and O(100n) are still both O(n). It's worthwhile at this point to explain that BigOh can be used to determine three cases with an algorithm:


Normally we don't care about the best case. We're interested in the expected and worst case. Sometimes one or the other of these will be more important. Back to the telephone book. What if you have a phone number and want to find a name? The police have a reverse phone book but such look-ups are denied to the general public. Or are they? Technically you can reverse look-up a number in an ordinary phone book. How? You start at the first name and compare the number. If it's a match, great, if not, you move on to the next. You have to do it this way because the phone book is (by phone number anyway). So to find a name given the phone number (reverse lookup):


The Traveling Salesman

This is quite a famous problem in computer science and deserves a mention. In this problem, you have N towns. Each of those towns is linked to 1 or more other towns by a road of a certain distance. The Traveling Salesman problem is to find the shortest tour that visits every town. Sounds simple? Think again. If you have 3 towns A, B, and C with roads between all pairs then you could go:


Well, actually there's less than that because some of these are equivalent (A → B → C and C → B → A are equivalent, for example, because they use the same roads, just in reverse). In actuality, there are 3 possibilities.


This is a function of a mathematical operation called a . Basically:


So the BigOh of the Traveling Salesman problem is or .

Something to think about.

Polynomial Time

Another point I wanted to make a quick mention of is that any algorithm that has a complexity of is said to have or is solvable in . O(n), O(n) etc. are all polynomial time. Some problems cannot be solved in polynomial time. Certain things are used in the world because of this. Public Key Cryptography is a prime example. It is computationally hard to find two prime factors of a very large number. If it wasn't, we couldn't use the public key systems we use. Anyway, that's it for my (hopefully plain English) explanation of BigOh (revised).

Up Vote9Down Vote
Grade: A

Sure, I'd be happy to provide a plain English explanation of "Big O" notation.

Big O notation is a way to describe how the running time or space usage of an algorithm grows as the size of the input increases. It's a way to measure the efficiency of an algorithm.

Imagine you have a simple task, like adding up all the numbers in a list. If the list has 10 numbers, it might take your computer a certain amount of time to do the calculation. If the list has 100 numbers, it might take a bit longer. If the list has 1,000 numbers, it might take even longer.

Big O notation helps us understand how the running time of the algorithm changes as the input size changes. For example, if the running time of an algorithm is proportional to the size of the input, we say it has a "linear" time complexity, and we can describe it using the Big O notation O(n), where "n" represents the size of the input.

On the other hand, if the running time of an algorithm is proportional to the square of the size of the input, we say it has a "quadratic" time complexity, and we can describe it using the Big O notation O(n^2).

The key idea is that Big O notation gives us a way to compare the efficiency of different algorithms, even if they have very different running times. It helps us understand how the algorithm will perform as the input size grows, which is important when we're dealing with large amounts of data.

For example, if you have two algorithms that both solve the same problem, but one has a time complexity of O(n) and the other has a time complexity of O(n^2), the first algorithm will be much more efficient for large inputs, because its running time will grow more slowly as the input size increases.

So, in simple terms, Big O notation is a way to describe the efficiency of an algorithm, and it helps us understand how the algorithm will perform as the input size grows.

Up Vote9Down Vote
Grade: A

Big O notation is a way to describe how the running time or space requirements of an algorithm increase as the input size grows. It provides an upper bound on the growth rate of the algorithm.

Here's a simple, plain English explanation of Big O notation without much formal definition or complex mathematics:

Imagine you have a task to complete, like reading a book. The Big O notation describes how the time to finish the book increases as the size of the book grows.

  • If the book gets 10 times larger, does it take 10 times longer to read?
  • Or does it take twice as long?
  • Or perhaps the time doesn't change at all?

Big O notation helps us answer these questions and compare different algorithms.

Here are a few common Big O notations:

  1. O(1) - Constant Time:

    • No matter how big the input is, the algorithm always takes the same amount of time.
    • Example: Accessing an element in an array by its index.
  2. O(n) - Linear Time:

    • The running time increases linearly with the size of the input.
    • If the input size doubles, the running time also doubles.
    • Example: Searching for an element in an unsorted array.
  3. O(log n) - Logarithmic Time:

    • The running time increases by a constant amount for each doubling of the input size.
    • Example: Binary search in a sorted array.
  4. O(n^2) - Quadratic Time:

    • The running time is proportional to the square of the input size.
    • If the input size doubles, the running time increases by four times.
    • Example: Nested loops, like in a simple sorting algorithm (e.g., Bubble Sort).

These are just a few examples, and there are other Big O notations as well.

In simple terms, Big O notation helps us understand how an algorithm's performance scales with the input size. It provides a way to compare different algorithms and choose the most efficient one for a given problem.

Remember, Big O notation represents the worst-case scenario or the upper bound of the growth rate. It gives us an idea of how an algorithm will perform in the worst case as the input size becomes very large.

Up Vote9Down Vote
Grade: A

Sure, I'll try to explain Big O notation in plain English with minimal formal definitions and mathematics.

Big O notation is a way to measure how efficient an algorithm is, specifically how the running time or space requirements for an algorithm increase as the input size gets bigger.

Imagine you have a grocery list with 10 items, and you need to check if a particular item is on the list. You'd have to look at each item one by one until you either find it or reach the end of the list. This is an example of a simple algorithm.

Now, if your grocery list had 100 items instead of 10, it would take longer to check for a particular item because you'd have to look through more items. The running time of the algorithm increases as the input size (the number of items on the list) gets bigger.

Big O notation gives us a way to describe this increase in running time or space requirements. For example, if we say an algorithm has a time complexity of O(n), it means that as the input size (n) increases, the running time of the algorithm increases at the same rate. So if the input size doubles, the running time also doubles.

Here are some common Big O notations and what they mean in plain English:

  1. O(1) (constant time): No matter how big the input is, the algorithm will take about the same amount of time. For example, adding two numbers together has a time complexity of O(1) because it takes the same amount of time regardless of how big the numbers are.

  2. O(n) (linear time): As the input size increases, the running time increases at the same rate. For example, finding an item in an unsorted list has a time complexity of O(n) because, in the worst case, you'd have to look at every item in the list.

  3. O(n^2) (quadratic time): As the input size increases, the running time increases much faster, proportional to the square of the input size. For example, a simple algorithm to find pairs of numbers in a list that sum to a target value has a time complexity of O(n^2) because it has to check every pair of numbers.

  4. O(log n) (logarithmic time): As the input size increases, the running time increases very slowly, much slower than linear time. For example, binary search on a sorted list has a time complexity of O(log n) because it eliminates half of the remaining items on each step.

The goal in algorithm design is to have algorithms with lower time and space complexities, like O(1), O(log n), or O(n), because they scale better for larger inputs. Algorithms with higher complexities like O(n^2) or O(n^3) can become very slow or use too much memory for large inputs.

In summary, Big O notation is a way to describe how the running time or space requirements of an algorithm increase as the input size gets bigger, without getting too bogged down in the specific calculations or constants involved.

Up Vote9Down Vote
Grade: A

Sure. A plain English explanation of the Big O notation is:

Big O Notation:

What it is:

  • It tells us how something grows or decreases compared to other things as it increases.
  • It's like a "big picture" comparison of growth rates.

Think of it like:

  • Imagine you have two functions, one that grows much faster than the other.
  • The Big O notation tells you that one function has a growth rate that is at least as fast as the other.

How it's used:

  • We put a number next to a Big O notation to indicate its growth rate.
  • For example, "O(n)" means that the growth rate is O(n), which means it grows at a rate not slower than n.

Example:

  • If function A has O(n²) growth rate, meaning it grows n squared times faster than function B, then function A is O(n²).

Key points:

  • Big O notation tells you the upper bound of the growth rate.
  • It doesn't tell you the exact growth rate (it could be slower or faster).
  • It helps you compare different functions based on their growth rates.

In summary:

Big O notation tells you how something grows or decreases compared to other things, based on its growth rate. It's a useful tool for understanding and comparing the growth rates of functions.

Up Vote8Down Vote
Grade: B

Big O Notation is a theoretical concept in computer science, used to describe the performance or complexity of an algorithm. It's about how the run time grows relative to the input as the size of the input increases.

In simpler terms, Big O notation describes the worst-case scenario, or how slowly running your algorithm would be with a large amount of data.

For instance, if you have an algorithm that goes through every element in a list (like going through it twice to find a specific item), this is considered linear time complexity and we represent it as O(n) because the run time grows linearly with the number of inputs n.

Another example: if there's one operation at each step, no matter how large your data set gets, that would be constant time, denoted by an uppercase letter O like O(1). This happens very fast regardless of size as it always takes a fixed amount of steps (in this case just one step).

So basically Big O notation describes the most dominant part of any function in relation to the input data size. It helps us compare different algorithm’s efficiency and spot where we might want to improve performance.

Up Vote8Down Vote
Grade: B

Big O notation is a way to express the time complexity or space complexity of an algorithm, describing how the running time or space requirements grow as the input size increases.

In simple terms, Big O notation describes the upper bound of the time complexity in the worst-case scenario. It measures the scaling factor of an algorithm when the input size increases.

For example, if we have an algorithm with time complexity O(n), it means that if we double the input size, the time it takes to run the algorithm will also approximately double. If an algorithm has time complexity O(n^2), increasing the input size will have a more significant impact on the time it takes to run the algorithm.

Let's look at some common Big O notations and their real-world algorithm examples to better understand this concept:

  1. O(1): Constant time complexity. No matter how big the input size is, the time taken to complete the operation remains constant. Example: Accessing an array element by its index.
def get_element(arr, index):
    return arr[index]  # Constant time complexity O(1)
  1. O(log n): Logarithmic time complexity. The time taken to complete the operation increases logarithmically with the input size. Example: Binary search.
def binary_search(arr, target):
    low, high = 0, len(arr) - 1
    while low <= high:
        mid = (low + high) // 2
        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            low = mid + 1
        else:
            high = mid - 1
    return -1  # Logarithmic time complexity O(log n)
  1. O(n): Linear time complexity. The time taken to complete the operation increases linearly with the input size. Example: Finding an element in an unsorted list or array.
def linear_search(arr, target):
    for i in range(len(arr)):
        if arr[i] == target:
            return i
    return -1  # Linear time complexity O(n)
  1. O(n log n): Linearithmic time complexity. The time taken to complete the operation increases linearly and logarithmically with the input size. Example: Quick sort or merge sort.

  2. O(n^2): Quadratic time complexity. The time taken to complete the operation increases with the square of the input size. Example: Bubble sort, selection sort, or insertion sort.

def bubble_sort(arr):
    n = len(arr)
    for i in range(n):
        for j in range(0, n - i - 1):
            if arr[j] > arr[j + 1]:
                arr[j], arr[j + 1] = arr[j + 1], arr[j]  # Quadratic time complexity O(n^2)

These are some of the most common Big O notations you will encounter. By understanding them, you can analyze and compare algorithms to determine their efficiency in terms of time and space complexity.

Up Vote8Down Vote
Grade: B

In computer science, Big-O (pronounced like Big O) notation is a way to describe the time complexity or space complexity of an algorithm, which represents how quickly it grows with respect to the size of the input.

The notation describes the relationship between the number of operations performed by an algorithm and the size of its input. The big-O symbol (Ω) represents the upper bound on the running time of the algorithm as a function of its input size. For example, O(n) indicates that the algorithm takes a linear amount of time, meaning it's proportional to n.

The purpose of Big O notation is to classify algorithms based on their worst-case complexity and compare them to one another. A low big-O value represents an efficient algorithm with fast running times, while a higher big-O value suggests that the algorithm will take longer as input size grows larger.

You're designing an algorithm for managing a music database of songs from various artists, where each song is characterized by its title (string), artist name (also a string), release date (a date), and length (in seconds). You've narrowed your options down to four algorithms:

Algorithm A: Queries the entire database every time you need a new record. It can search through up to 5000 entries per second, but slows down after this point. The Big-O notation for this algorithm is O(n), where n represents the number of songs in the database.

Algorithm B: Uses an index to speed up searches and queries only one entry at a time. This ensures that the maximum rate at which entries can be queried is 5000, but it's still slower than Algorithm A when searching for very large databases. Its Big-O notation is O(n^2) due to its linear search algorithm within each query.

Algorithm C: Stores and searches all song metadata (title, artist name, release date, and length) in an in-memory array with a capacity of 5000 songs. It can fetch records faster because it avoids reading the data from disk every time, but it requires additional memory to hold the whole database. Its Big-O notation is O(1) for read operations, and O(n) for write operations.

Algorithm D: Uses a distributed system architecture, where each node in a network has a copy of your song database and queries other nodes when necessary. This reduces the load on individual nodes but requires additional coordination time to execute queries across multiple nodes, resulting in slower overall performance. Its Big-O notation is O(log n) for network operations, assuming that the network can handle up to 10^5 nodes at a time.

Question: You are developing an application which needs to query more than 10k entries per second but has enough memory to hold all song records (i.e., there's no need to store or retrieve data from disk). Which algorithm should you choose, and why?

The first step in determining which algorithm is best suited for the situation involves understanding that Big O notation alone does not take into consideration the constraints of your current situation; such as available memory or processing power. Therefore, we'll now incorporate the property of transitivity in logic: if Algorithm A takes longer than B and B takes longer than C (assuming you can use only one algorithm at a time), then it logically follows that Algorithm A would take more time than Algorithm C to process a given amount of data (that is, they're both O(n)).

The second step involves considering the capacity of your memory. Since the problem states "enough to hold all song records," this essentially means you have an in-memory array that can contain the full size of your database (n). Hence, we're only comparing Algorithms C and D which have their O notation tied with their read operations, which are limited by available memory capacity.

Applying deductive logic: Since we need a solution that doesn't take more time than B, but is better suited for our problem of high data input speed without disk access (given in the question), and since algorithm D takes O(log n) to query from 10^5000 nodes (i.e., 5000 songs). It would make sense to go for algorithm D considering its optimized query efficiency (O(log n)), even though it might not be an ideal solution due to additional network operations, which we can manage with reasonable system load. Answer: You should choose Algorithm D because, given the conditions mentioned in your question and provided by the algorithms' Big O notations, it's expected to handle queries faster than algorithm C and is within the constraints of memory capacity you have available.

Up Vote7Down Vote
Grade: B

"Big O" notation is used to measure how the amount of work done by an algorithm grows as its input size increases. It can be thought of like a benchmark for measuring the growth of an algorithms' run-time. This helps developers optimize their algorithms and write more efficient code. The "O" refers to a specific method or technique known as the order of the notation. The amount of work done by an algorithm is measured in terms of the size of its input, so if an algorithm has a time complexity of O(n), where n is the size of the input, the run time will grow with the size of the input. This means that if we double the size of our input, the runtime will double. For instance, a for-each loop with a linear search might have a big O of O(n^2), which means that as the length of an array grows, so does the number of steps taken to find a certain value inside of it.

Up Vote7Down Vote
Grade: B

What is "Big O" Notation?

Imagine you have a recipe for a cake. The recipe tells you that it takes 2 minutes to mix the batter and 1 minute to bake it. Now, suppose you want to make multiple cakes. How long will it take to make N cakes?

Here's where "Big O" notation comes in. It's a way to talk about how long an algorithm (a recipe for solving a problem) will take as the input size (the number of cakes) gets larger and larger.

The "O" in "Big O"

The "O" in "Big O" notation stands for "order of growth." It's like the pattern of how the time to complete a task increases as the input size increases.

Plain English Explanation:

For our cake recipe, the time it takes to make N cakes is 2 minutes (mixing batter) + 1 minute (baking) * N. As N gets larger, the time it takes to bake the cakes (1 minute * N) grows much faster than the time it takes to mix the batter (2 minutes).

We say that the time complexity of our cake recipe is O(N), which means that the time it takes to make N cakes grows in the same order as N.

Key Points:

  • "Big O" notation is a way to describe how long an algorithm takes as the input size gets larger.
  • The "O" stands for "order of growth."
  • The time complexity of our cake recipe is O(N), which means that the time it takes to make N cakes grows in the same order as N.
Up Vote6Down Vote
Grade: B

Sure, here is a plain English explanation of "Big O" notation with simple mathematics:

Big O notation describes the upper bound of a function's growth rate in comparison to another function. It's like saying how much the function will increase as its input grows infinitely.

Imagine you have two functions, f(x) and g(x). Big O notation tells you how much f(x) can be bigger than g(x) as x gets larger and larger.

Here's the math:

Big O(n) = f(n) is O(g(n)) if lim (n→∞) [f(n)/g(n)] = c for some constant c > 0

What this means is:

  • Big O(n) is like a ceiling function that bounds the upper limit of f(n).
  • g(n) is the function that defines the upper bound.
  • c is a constant multiplier that can be adjusted to fit the specific function.

For example, the function f(x) = 2x + 1 has a Big O notation of O(x) because the growth rate of f(x) is bounded above by the growth rate of x.

So, Big O notation is a way to describe the upper bound of a function's growth rate in simple terms. It helps programmers compare the efficiency of different algorithms and data structures.

Up Vote6Down Vote
Grade: B

Quick note, my answer is almost certainly confusing Big Oh notation (which is an upper bound) with Big Theta notation "Θ" (which is a two-side bound). But in my experience, this is actually typical of discussions in non-academic settings. Apologies for any confusion caused.


BigOh complexity can be visualized with this graph: The simplest definition I can give for Big Oh notation is this:

There are some important and deliberately chosen words in that sentence:


Come back and reread the above when you've read the rest. The best example of BigOh I can think of is doing arithmetic. Take two numbers (123456 and 789012). The basic arithmetic operations we learned in school were:


Each of these is an operation or a problem. A method of solving these is called an . The addition is the simplest. You line the numbers up (to the right) and add the digits in a column writing the last number of that addition in the result. The 'tens' part of that number is carried over to the next column. Let's assume that the addition of these numbers is the most expensive operation in this algorithm. It stands to reason that to add these two numbers together we have to add together 6 digits (and possibly carry a 7th). If we add two 100 digit numbers together we have to do 100 additions. If we add 10,000 digit numbers we have to do 10,000 additions. See the pattern? The (being the number of operations) is directly proportional to the number of digits in the larger number. We call this or . Subtraction is similar (except you may need to borrow instead of carry). Multiplication is different. You line the numbers up, take the first digit in the bottom number and multiply it in turn against each digit in the top number and so on through each digit. So to multiply our two 6 digit numbers we must do 36 multiplications. We may need to do as many as 10 or 11 column adds to get the end result too. If we have two 100-digit numbers we need to do 10,000 multiplications and 200 adds. For two one million digit numbers we need to do one trillion (10) multiplications and two million adds. As the algorithm scales with n-, this is or . This is a good time to introduce another important concept:

The astute may have realized that we could express the number of operations as: n + 2n. But as you saw from our example with two numbers of a million digits apiece, the second term (2n) becomes insignificant (accounting for 0.0002% of the total operations by that stage). One can notice that we've assumed the worst case scenario here. While multiplying 6 digit numbers, if one of them has 4 digits and the other one has 6 digits, then we only have 24 multiplications. Still, we calculate the worst case scenario for that 'n', i.e when both are 6 digit numbers. Hence Big Oh notation is about the Worst-case scenario of an algorithm.

The Telephone Book

The next best example I can think of is the telephone book, normally called the White Pages or similar but it varies from country to country. But I'm talking about the one that lists people by surname and then initials or first name, possibly address and then telephone numbers. Now if you were instructing a computer to look up the phone number for "John Smith" in a telephone book that contains 1,000,000 names, what would you do? Ignoring the fact that you could guess how far in the S's started (let's assume you can't), what would you do? A typical implementation might be to open up to the middle, take the 500,000 and compare it to "Smith". If it happens to be "Smith, John", we just got really lucky. Far more likely is that "John Smith" will be before or after that name. If it's after we then divide the last half of the phone book in half and repeat. If it's before then we divide the first half of the phone book in half and repeat. And so on. This is called a and is used every day in programming whether you realize it or not. So if you want to find a name in a phone book of a million names you can actually find any name by doing this at most 20 times. In comparing search algorithms we decide that this comparison is our 'n'.


That is staggeringly good, isn't it? In BigOh terms this is or . Now the logarithm in question could be ln (base e), log, log or some other base. It doesn't matter it's still O(log n) just like O(2n) and O(100n) are still both O(n). It's worthwhile at this point to explain that BigOh can be used to determine three cases with an algorithm:


Normally we don't care about the best case. We're interested in the expected and worst case. Sometimes one or the other of these will be more important. Back to the telephone book. What if you have a phone number and want to find a name? The police have a reverse phone book but such look-ups are denied to the general public. Or are they? Technically you can reverse look-up a number in an ordinary phone book. How? You start at the first name and compare the number. If it's a match, great, if not, you move on to the next. You have to do it this way because the phone book is (by phone number anyway). So to find a name given the phone number (reverse lookup):


The Traveling Salesman

This is quite a famous problem in computer science and deserves a mention. In this problem, you have N towns. Each of those towns is linked to 1 or more other towns by a road of a certain distance. The Traveling Salesman problem is to find the shortest tour that visits every town. Sounds simple? Think again. If you have 3 towns A, B, and C with roads between all pairs then you could go:


Well, actually there's less than that because some of these are equivalent (A → B → C and C → B → A are equivalent, for example, because they use the same roads, just in reverse). In actuality, there are 3 possibilities.


This is a function of a mathematical operation called a . Basically:


So the BigOh of the Traveling Salesman problem is or .

Something to think about.

Polynomial Time

Another point I wanted to make a quick mention of is that any algorithm that has a complexity of is said to have or is solvable in . O(n), O(n) etc. are all polynomial time. Some problems cannot be solved in polynomial time. Certain things are used in the world because of this. Public Key Cryptography is a prime example. It is computationally hard to find two prime factors of a very large number. If it wasn't, we couldn't use the public key systems we use. Anyway, that's it for my (hopefully plain English) explanation of BigOh (revised).

Up Vote6Down Vote
Grade: B

Sure, I can provide an explanation of Big O notation in plain English. Big O notation is a way to express how the performance of a function depends on its input size. It is used to compare different algorithms or to analyze the complexity of a specific operation. In plain English, Big O notation is a measure of how fast a function runs as you increase its input size. It gives an idea of which algorithm or operation would be best suited for a given task.

Up Vote5Down Vote
Grade: C

Big O notation is a way to describe the performance or complexity of an algorithm, particularly in relation to the input size. It gives us an idea of how the running time or space requirements grow as the input gets larger.

Think of it this way: Imagine you're comparing different algorithms for performing the same task, like sorting a list of numbers. You might notice that one algorithm seems faster than another when dealing with small lists, but the difference becomes much more pronounced with larger ones. Big O notation helps us quantify and understand this behavior.

For instance, an algorithm with a performance of "O(n)" (Big O of n) would mean its running time grows linearly with the input size: if you double the input, it takes about twice as long to run; if you triple the input, it'll take around three times as long, and so on. This is considered relatively simple and efficient, like Bubble Sort or Insertion Sort algorithms.

On the other hand, an algorithm with a performance of "O(n^2)" (Big O squared of n) would mean its running time grows much faster than linearly: if you double the input, it might take 4, 9, or even 16 times longer to run. This is considered less efficient for larger inputs, like Bubble Sort when sorting large lists.

Big O notation abstracts these complexities by focusing on the most dominant term in the algorithm's complexity. By comparing different algorithms using Big O notation, you can easily determine which one scales better with increasing input size and thus is more likely to be a good choice for larger data sets or more demanding tasks.