Author -  Sai gowtham

Intro to Logarithms

What is Logarithms?

  • Logarithms are the inverse of exponentiation.
  • Logarithms were introduced by John Napier to simplify the calculations.

👀 some maths logbase value = exponent   👉   baseexponent = value

log2 8 = 3   👉   23 = 8 . (2x2x2 = 8)

The logarithm of base 2 of 8 is 3 it means that we need to raise the exponent of base 2 to produce the value 8.

log2 16 = 4   👉   24 = 16

the logarithm of base 2 of 16 is 4.

Logarithms are not always with the base 2 but in computer science, we mostly use base 2.

Binary search algorithm with logarithmic complexity

Binary search is used in the sorted data sets it begins with the comparing middle element of the array with the target value if the target value matches then its position is returned. If the target value is less than the middle element, the search continues in the lower half of the array. If the target value is greater than the middle element, the search continues in the upper half of the array. This process continues until it no longer split the array.

binary search

In the above example, we chopped the array 3 times to get the target value.

The big O time complexity of binary search is O(log n).

O(log n)

logn definition

Css Tutorials & Demos

How rotate an image continuously in CSS

In this demo, we are going to learn about how to rotate an image continuously using the css animations.

How to create a Instagram login Page

In this demo, i will show you how to create a instagram login page using html and css.

How to create a pulse animation in CSS

In this demo, i will show you how to create a pulse animation using css.

Creating a snowfall animation using css and JavaScript

In this demo, i will show you how to create a snow fall animation using css and JavaScript.

Top Udemy Courses

JavaScript - The Complete Guide 2023 (Beginner + Advanced)
JavaScript - The Complete Guide 2023 (Beginner + Advanced)
116,648 students enrolled
52 hours of video content
$14.99 FROM UDEMY
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
631,582 students enrolled
49 hours of video content
$24.99 FROM UDEMY
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
203,937 students enrolled
31.5 hours of video content
$14.99 FROM UDEMY