Skip to main content

Posts

Algorithms language Chapter 2: Algorithm Complexity (Part-2)

  Chapter 2: Algorithm Complexity Section 2.2: Comparison of the asymptotic notations The asymptotic notations can be represented on a Venn diagram as follows:

Algorithms language Chapter 2: Algorithm Complexity (Part-1)

Chapter 2: Algorithm Complexity Section 2.1: Big-Theta notation Unlike Big-O notation, which represents only upper bound of the running time for some algorithm, Big-Theta is a tight bound; both upper and lower bound. Tight bound is more precise, but also more difficult to compute. The Big-Theta notation is symmetric: f(x) = Ө(g(x)) <=> g(x) = Ө(f(x)) An intuitive way to grasp it is that f(x) = Ө(g(x)) means that the graphs of f(x) and g(x) grow in the same rate, or that the graphs 'behave' similarly for big enough values of x. The full mathematical expression of the Big-Theta notation is as follows: Ө(f(x)) = {g: N0 -> R and c1, c2, n0 > 0, where c1 < abs(g(n) / f(n)), for every n > n0 and abs is the absolute value } An example If the algorithm for the input n takes 42n^2 + 25n + 4 operations to finish, we say that is O(n^2), but is also O(n^3) and O(n^100). However, it is Ө(n^2) and it is not Ө(n^3), Ө(n^4) etc. Algorithm that is Ө(f(n)) is also O(f(n)), but

Algorithms language Chapter 1: Getting started with algorithms (Part-2)

Chapter 1: Getting started with algorithms Section 1.2: Getting Started with Simple Fizz Buzz Algorithm in  Swift For those of you that are new to programming in Swift and those of you coming from different programming bases, such as Python or Java, this article should be quite helpful. In this post, we will discuss a simple solution for implementing swift algorithms. Fizz Buzz You may have seen Fizz Buzz written as Fizz Buzz, FizzBuzz, or Fizz-Buzz; they're all referring to the same thing. That "thing" is the main topic of discussion today. First, what is FizzBuzz? This is a common question that comes up in job interviews. Imagine a series of a number from 1 to 10. 1 2 3 4 5 6 7 8 9 10 Fizz and Buzz refer to any number that's a multiple of 3 and 5 respectively. In other words, if a number is divisible by 3, it is substituted with fizz; if a number is divisible by 5, it is substituted with buzz. If a number is simultaneously a multiple of 3 AND 5, the number is replac

Algorithms language Chapter 1: Getting started with algorithms (Part-1)

Chapter 1: Getting started with algorithms Section 1.1: A sample algorithmic problem An algorithmic problem is specified by describing the complete set of instances it must work on and of its output after running on one of these instances. This distinction, between a problem and an instance of a problem, is fundamental. The algorithmic problem known as sorting is defined as follows: [Skiena:2008:ADM:1410219] Problem: Sorting Input: A sequence of n keys, a_1, a_2, ..., a_n. Output: The reordering of the input sequence such that a'_1 <= a'_2 <= ... <= a'_{n-1} <= a'_n An instance of sorting might be an array of strings, such as { Haskell, Emacs } or a sequence of numbers such as { 154, 245, 1337 }.

The Ultimate Guide to Network Security Firewalls: Keep Your Data Safe

  The Ultimate Guide to Network Security Firewalls: Keep Your Data Safe   Cyber threats have become universal due to digitization and automation. Added to that, the COVID-19 pandemic has increased the number of cyberattacks across industries. A   2021 report   reveals that India saw a 300% rise in cyberattacks during the COVID-19 pandemic. As per experts, the rise in cyberattacks is due to a lack of cybersecurity awareness and increased online activity. With increased digitization, all businesses face the threat of cyberattacks. There are various steps that companies can take to safeguard themselves, and network security firewalls are one of them.  So let’s understand the firewall concept in detail and also the best practices for securing networks. What is a Network Security Firewall? A firewall is a network security device that filters traffic based on defined security rules. It uses set rules to accept (allow traffic), drop (block traffic with no reply), and reject (block the traffic

Object-Oriented Programming (OOPS)

 Object-Oriented Programming (OOPS) OOPS stands for "Object-Oriented Programming" and is a programming paradigm that focuses on the creation and manipulation of objects. In object-oriented programming, software is organized around objects, which are instances of classes that encapsulate data and behavior. The main principles of object-oriented programming include: Encapsulation: Objects encapsulate data and behavior together, hiding the internal details and exposing a public interface for interacting with the object. Inheritance: Classes can inherit properties and methods from other classes, forming a hierarchy of classes. Inheritance allows for code reuse and the creation of specialized classes based on existing ones. Polymorphism: Polymorphism allows objects of different classes to be treated as objects of a common superclass. This enables the use of generic code that can operate on objects of different types, providing flexibility and extensibility. Abstraction: Abstractio