Apache Kafka is a distributed data store optimized for ingesting and processing streaming data in real-time. Streaming data is data that is continuously generated by thousands of data sources, which typically send the data records in simultaneously. A streaming platform …
Python’s property() is the Pythonic way to avoid formal getter and setter methods in your code. This function allows you to turn class attributes into properties or managed attributes. Since property() is a built-in function, you can use it without importing anything. Additionally, property() was implemented in C to …
Multi-version concurrency control (MVCC) is currently the most popular transaction management scheme in modern database management systems (DBMSs). Although first proposed in 1978 MIT Ph.D. dissertation, it is used in almost every major relational DBMS released in the last decade. …
Computers represent all data internally as sequences of bits. Each bit can assume the value 0 or the value 1. The bitwise operators are used to manipulate the bits of integral operands both signed and unsigned. Unsigned integers are normally …
Competitive Programming is a mental sport that enables you to code a given problem under provided constraints. The aim of competitive programming is to write source code of computer programs which are able to solve given problems. A vast majority …
Dynamic programming is an optimization approach that transforms a complex problem into a sequence of simpler problems; its essential characteristic is the multistage nature of the optimization procedure. More so than the optimization techniques described previously, dynamic programming provides a …
Graph theory may be said to have its beginning in 1736 when EULER considered the (general case of the) Königsberg bridge problem: Does there exist a walk crossing each of the seven bridges of Königsberg exactly once? The Königsberg Bridge …
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge u v, vertex u comes before v in the ordering. Topological Sorting for a graph is not possible if the graph …
Two pointers pattern is typically used for searching pairs in a sorted array. Given a sorted array nums (sorted in ascending order), having N integers, find if there exists any pair of elements (nums[i], nums[j]) such that their sum is equal to …
In computer science, k-way merge algorithms or multiway merges are a specific type of sequence merge algorithms that specialize in taking in k sorted lists and merging them into a single sorted list. These merge algorithms generally refer to …
Cycle sort is an in-place sorting Algorithm, unstable sorting algorithm, a comparison sort that is theoretically optimal in terms of the total number of writes to the original array. Cycle sort is the most efficient in terms …
Depth-first search is an algorithm for traversing or searching tree or graph data structures. Extra memory, usually a stack, is needed to keep track of the nodes discovered so far along a specified branch which helps in backtracking of the graph. This …
Breadth-first search (BFS) is an algorithm for searching a tree data structure for a node that satisfies a given property. It starts at the tree root and explores all nodes at the present depth prior …
We will introduce in-place reversal of a linked list pattern, which is very useful to solve the problems involving reversal of a Linked List with the constraint that we need to do it in-placewithout using extra memory.
A simple approach is to start from the first interval and compare it with all other intervals for overlapping, if it overlaps with any other interval, then remove the other interval from the list and merge the …
The fast and slow pointer technique (also known as the tortoise and hare algorithm) uses two pointers to determine traits about directional data structures. This can be an array, singly-linked list, or a graph. It is often applied to determine …
The Sliding window is a problem-solving technique that aims to reduce the use of nested loop and replace it with a single loop, thereby reducing the time complexity. These problems are easy to solve using a brute force approach in …
String matching strategies or algorithms provide a key role in various real-world problems or applications. A few of its imperative applications are Spell Checkers, Spam Filters, Intrusion Detection System, Search Engines, Plagiarism Detection, Bioinformatics, Digital Forensics and Information Retrieval Systems etc. It is …
When analyzing algorithms, recall that we only care about asymptotic behavior. Recursive algorithms are no different. Rather than solve exactly the recurrence relation associated with the cost of an algorithm, it is enough to give an asymptotic characterization. The Master's …
Pattern Searching algorithms are also known as String Searching Algorithm, which is used to find a pattern or substring from another bigger string. There are different algorithms. The main goal to design these type of algorithms to reduce the …
Z algorithm is an algorithm for searching a given pattern in a string, which is an efficient algorithm as it has linear time complexity. It has a time complexity of O(m+n), where m is the length of the string and …
Knuth Morris Pratt (KMP) is an algorithm, which checks the characters from left to right. However, at whatever point a mismatch happens, it utilizes a preprocessed table called "Prefix Table" to skip characters examination while matching. A few times prefix …
Rabin–Karp algorithm or Karp–Rabin algorithm is a string-searching algorithm created by Richard M. Karp and Michael O. Rabin in 1987 that uses hashing to find an exact match of a pattern string in a text. It also checks the pattern …
A trie, pronounced “try” and also called digital tree or prefix tree, is a special data structure used to store strings that can be visualized like a graph. Comes from the word retrieval. It consists of …
Manacher's algorithm is used to find the longest palindromic substring in linear time. It is required to solve sub-problems of some very hard problems. The problem statement it solves is: Given a string 's' with the length of 'n'. …
Searching algorithms are used to find a specified element within a data structure. Numerous different searching algorithms exist, each of which is suited to a particular data structure of format of data. Different searching algorithms are used depending …
A suffix array is a sorted array of all suffixes of a given string. After sorting the suffixes in lexicographical order, we can get the suffix array. Suffix arrays can also be formed using suffix trees. A suffix array …
In computer science, amortized analysis is a method for analyzing a given algorithm's complexity, or how much of a resource, especially time or memory, it takes to execute. The motivation for amortized analysis is that looking at …
The Fibonacci sequence is a series of numbers in which each number is the sum of the two that precede it. Starting at 0 and 1, the sequence looks like this: 0, 1, 1, 2, 3, 5, 8, 13, 21, …
Classification of UNIX/Linux UNIX is a Multi-User/Multi-Tasking operating system and exists in many different versions:Solaris, AIX, XENIX, HP-UX, SINIX, Linux. Operating System (OS): Sum of all programs which are required to operate a computer and which control and …
TCP stands for Transmission Control Protocol a communications standard that enables application programs and computing devices to exchange messages over a network. It is designed to send packets across the internet and ensure the successful delivery of data …
Python provides a good coverage on the low-level networking interface. It all starts with BSD(Berkeley Software Distribution) socket interface. As you can assume, Python has a socket module that gives you the necessary functionality to work with the socket …
The IP address labels a machine's network interface with a numeric identifier, which also identifies the location of the machine, albeit with limited reliability. Domain Name System (DNS) is a core network service that maps the names to the IP addresses …
Like most WSGI-based web frameworks, Django is synchronous. When a client requests a web page, the request reaches Django through a view and passes through various lines of code until the rendered web page is returned. As …
There are many different kinds of tests, so many, in fact, that companies often have a dedicated department, called quality assurance (QA), made up of individuals who spend their day testing the software the company developers produce.
The collection Module in Python provides different types of containers. A Container is an object that is used to store different objects and provide a way to access the contained objects and iterate over them. Some of …
Descriptors are the basis of complex attribute access in Python. They are used internally to implement properties, methods, class methods, static methods, and super. They are objects that define how attributes of another class can be accessed. In other words, a class can …
Structural pattern matching introduces a match statement and two new soft keywords: match and case. As the name suggests, it can be used to match a given value against a list of specified "cases" and act accordingly to the match.
The nature of random numbers generated by the random module is sufficient for statistical purposes. It uses the Mersenne Twister pseudorandom number generator. It has a known uniform distribution and a long enough period length that it can be …
F-strings, also known as formatted string literals, are one of the most beloved Python features that came with Python 3.6. Introduced with PEP 498, they added a new way of formatting strings.
Type-hinting annotations allow you to annotate variable, argument, and function return types with type definitions. These type annotations serve documentational purposes, but can also be used to validate your code using external tools.
A graph is an ordered pair G=(V,E), where Vis a finite set and E ⊆ VxV. The elements of V are called nodes or vertices,and the elements of E are called edges.
Expressions and statements are the key building blocks of almost every programming language. The difference between them is really simple: expressions have a value, while statements do not.
Think of statements as consecutive actions or instructions that your program executes. …
Python, starting from version 3.9, makes access to the information regarding current and historical time zones easier than ever. The Python standard library provides a zoneinfo module that is an interface to the time zone database …