Algorithmic Complexity: Time and Space

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What dictates the ending of an ionic compound's name?

  • The charge of the cation.
  • The specific elements involved. (correct)
  • Whether it is a metal or non-metal.
  • The total number of elements in the compound.

Which group in the periodic table typically forms ions with a +2 charge?

  • Group 1
  • Group 2 (correct)
  • Group 17
  • Group 13

What is the correct formula for aluminum nitride?

  • AlN (correct)
  • Al2N3
  • Al3N
  • AlN3

What is the correct formula for potassium phosphide?

<p>K3P (A)</p> Signup and view all the answers

Which element is likely to exhibit a +1 or +2 oxidation number when forming ionic compounds?

<p>Copper (Cu) (D)</p> Signup and view all the answers

Which of the following elements is most likely to be involved in a binary ionic compound?

<p>Sodium (A)</p> Signup and view all the answers

What would be the name of $Ca_3N_2$?

<p>Calcium Nitride (D)</p> Signup and view all the answers

What is true of Group 17 elements when forming ionic compounds?

<p>They typically gain one electron to form -1 ions. (A)</p> Signup and view all the answers

Which of the following ionic compounds is incorrectly written?

<p>Aluminum Nitride = $Al_3N_3$ (A)</p> Signup and view all the answers

Which of the properties does Group 13 share?

<p>They can have a +3 oxidation number is ionic compounds (B)</p> Signup and view all the answers

What is true of ionic compounds?

<p>They end with -ide or -ele (D)</p> Signup and view all the answers

Which one is copper sulfide?

<p>All of the above (D)</p> Signup and view all the answers

What is true of Binary compounds?

<p>They contain 2 elements (A)</p> Signup and view all the answers

Which of the following could have multiple different oxidation numbers?

<p>All of the above (D)</p> Signup and view all the answers

What would Aluminum Bromide be?

<p>$AlBr_3$ (B)</p> Signup and view all the answers

What oxidation number would Group 15 have?

<p>-3 (A)</p> Signup and view all the answers

Which of the following is NOT a metal?

<p>Group 15 (C)</p> Signup and view all the answers

What is Sodium Oxide?

<p>$Na_2O$ (A)</p> Signup and view all the answers

What is true of Groups 1 and 2?

<p>They have variable oxidation numbers (D)</p> Signup and view all the answers

Flashcards

Naming Ionic Compounds

Naming compounds formed between a metal and a non-metal.

Binary Compound

A compound composed of two elements.

Ionic Compound Naming Convention

When naming ionic compounds, the ending is 'ide' or 'ede'.

CaFâ‚‚

Calcium Fluoride

Signup and view all the flashcards

Group 1 elements charge

Elements in Group 1 on the periodic tend to have a +1 charge.

Signup and view all the flashcards

Group 2 elements charge

Elements in Group 2 on the periodic tend to have a +2 charge.

Signup and view all the flashcards

Group 13 elements charge

Elements in Group 13 on the periodic table tend to have a +3 charge (metals).

Signup and view all the flashcards

Group 16 elements charge

Elements in Group 16 on the periodic table tend to have a -2 charge.

Signup and view all the flashcards

Group 17 elements charge

Elements in Group 17 on the periodic table tend to have a -1 charge (non-metals).

Signup and view all the flashcards

Copper Sulfide

An ionic compound formed from copper and sulfur.

Signup and view all the flashcards

Aluminum Bromide

An ionic compound made of aluminum and bromine.

Signup and view all the flashcards

Aluminum Nitride

An ionic compound composed of aluminum and nitrogen.

Signup and view all the flashcards

Naâ‚‚O

Sodium Oxide

Signup and view all the flashcards

K₃P

Potassium Phosphide

Signup and view all the flashcards

Cu

An element with a +1 or +2 oxidation state.

Signup and view all the flashcards

Hg Sn

An element with a +2 or +4 oxidation state.

Signup and view all the flashcards

Study Notes

Algorithmic Complexity

  • Measures the resources (time, space) an algorithm consumes.
  • Focus on time complexity, which is the computer time needed for an algorithm to complete.
  • Space complexity refers to the memory an algorithm requires to run.

Measuring Time Complexity

Experimental Analysis

  • Involves implementing the algorithm.
  • Running it with various input sizes and compositions.
  • Measuring the running time using methods like System.currentTimeMillis().
  • Plotting the results.

Theoretical Analysis

  • Determines running time as a function of input size.
    • Input Size is problem-dependent.
      • Sorting: number of items.
      • Searching: number of items in search space.
      • Graph Problem: number of vertices/edges.
  • Uses a high-level algorithm description.
  • Considers all possible inputs, independent of hardware/software.

Primitive Operations

  • These are basic computations independent of the environment
    • Expression evaluation.
    • Variable assignment.
    • Number comparison.
    • Method return.
  • Primitive operations take constant time $O(1)$ in the worst case.

Counting Primitive Operations

  • Number of operations executed by inspecting pseudo-code.
  • $T(n) = 1 + n + 2(n-1) + 2(n-1) + 1 = 5n - 2$ in the example provided.
  • Running time $T(n)$ is a linear function of $n$.

Growth Rate

  • Changing environment affects running time by a constant factor.
  • Linear growth rate of $T(n)$ remains unchanged, regardless of environment.
  • Growth rate isn't affected by constant factors or lower-order terms.

Asymptotic Notation

  • Focuses on the order of growth as input size increases.
  • Big-O notation: $O(f(n))$.
  • Big-Omega notation: $\Omega(f(n))$.
  • Big-Theta notation: $\theta(f(n))$.

Big-O Notation

  • $f(n)$ is $O(g(n))$ if there exist constants $c$ and $n_0$ such that $f(n) \le cg(n)$ for $n \ge n_0$.
  • $f(n)$ grows no faster than $g(n)$.
  • $2n + 10$ is $O(n)$ as $2n + 10 \le 3n$ for $n \ge 10$ (with $c = 3$ and $n_0 = 10$).

Big-Omega Notation

  • $f(n)$ is $\Omega(g(n))$ if there exist constants $c$ and $n_0$ such that $f(n) \ge cg(n)$ for $n \ge n_0$.
  • $f(n)$ grows at least as fast as $g(n)$.
  • $2n + 10$ is $\Omega(n)$ as $2n + 10 \ge 2n$ for $n \ge 1$ (with $c = 2$ and $n_0 = 1$).

Big-Theta Notation

  • $f(n)$ is $\theta(g(n))$ if there exist constants $c_1$, $c_2$, and $n_0$ such that $c_1g(n) \le f(n) \le c_2g(n)$ for $n \ge n_0$.
  • $f(n)$ grows at the same rate as $g(n)$.
  • $2n + 10$ is $\theta(n)$ as $2n \le 2n + 10 \le 3n$ for $n \ge 10$ (with $c_1 = 2$, $c_2 = 3$ and $n_0 = 10$).

Relationships Between $O$, $\Omega$, and $\theta$

  • $f(n)$ is $\theta(g(n))$ if and only if $f(n)$ is $O(g(n))$ and $f(n)$ is $\Omega(g(n))$.

Properties of Asymptotic Notation

  • Transitivity: If $f(n)$ is $O(g(n))$ and $g(n)$ is $O(h(n))$, then $f(n)$ is $O(h(n))$.
  • Similar transitivity properties hold for $\Omega$ and $\theta$.

Using Asymptotic Notation

  • Big-O notation describes worst-case running time.
  • Big-Omega notation describes best-case running time.
  • Big-Theta notation describes average-case running time.

Common Growth Rates

  • Constant: $\theta(1)$.
  • Logarithmic: $\theta(log n)$.
  • Linear: $\theta(n)$.
  • N-Log-N: $\theta(n log n)$.
  • Quadratic: $\theta(n^2)$.
  • Cubic: $\theta(n^3)$.
  • Exponential: $\theta(2^n)$.
  • Factorial: $\theta(n!)$.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

IMG-20250407-WA0003.jpeg

More Like This

Data Structures and Algorithms Quiz
5 questions
Data Structures and Time Complexity Quiz
24 questions
Data Structures and Algorithms Review
24 questions
Use Quizgecko on...
Browser
Browser