What is Convolution?Convolution is a mathematical tool to combining two signals to form a third signal. Therefore, in signals and systems, the convolution is very important because it relates the input signal and the impulse response of the system to produce the output signal from the system. In other words, the convolution is used to express the input and output relationship of an LTI system.ExplanationConsider a continuous-time LTI system which is relaxed at t = 0, i.e., initially, no input is applied to it. Now, if the impulse signal [δ(t)] is input to the system, then output of the system ... Read More
We are given a graph with a source vertex in the graph. And we have to find the shortest path from the source vertex to all other vertices of the graph. The Dijikstra's algorithm is a greedy algorithm to find the shortest path from the source vertex of the graph to the root node of the graph. Algorithm Step 1 : Create a set shortPath to store vertices that come in the way of the shortest path tree. Step 2 : Initialize all distance values as INFINITE and assign distance values as 0 for source vertex so that it is ... Read More
Problem − Consider the following grammar − E → TE′ E′ → +TE′|ε T′ → FT′ T′ → FT′|ε F → (E)|id Solution − Step1− Elimination of Left Recursion & perform Left Factoring As there is no left recursion in Grammar so, we will proceed as it is. Also, there is no need for Left Factoring. Step2− Computation of FIRST FIRST(E) = FIRST(T) = FIRST(F) = {(, id} FIRST (E′) = {+, ε} FIRST (T′) = {*, ε} Step3− Computation of FOLLOW FOLLOW (E) = FOLLOW(E′) = {), $} FOLLOW (T) = FOLLOW(T′) = {+, ), $} FOLLOW (F) = ... Read More
We can have two ways of creating an xpath – relative and absolute. The absolute xpath has the complete path beginning from the root to the element which we want to identify.An absolute xpath starts with the / symbol. One drawback with the absolute xpath is that if there is any change in attributes beginning from the root to the element, our absolute xpath will become invalid.The relative xpath starts by referring to the element that we want to identify and not from the root node. A relative xpath starts with the // symbol. It is mainly used for automation ... Read More
The & symbol is used as an operator in C++. It is used in 2 different places, one as a bitwise and operator and one as a pointer address of operator.Bitwise ANDThe bitwise AND operator (&) compares each bit of the first operand to that bit of the second operand. If both bits are 1, the bit is set to 1. Otherwise, the bit is set to 0. Both operands to the bitwise AND operator must be of integral types. Example #include using namespace std; int main() { unsigned short a = 0x5555; // pattern 0101 ... unsigned short b = 0xAAAA; // pattern 1010 ... cout
In an undirected graph, the Hamiltonian path is a path, that visits each vertex exactly once, and the Hamiltonian cycle or circuit is a Hamiltonian path, that there is an edge from the last vertex to the first vertex. In this problem, we will try to determine whether a graph contains a Hamiltonian cycle or not. And when a Hamiltonian cycle is present, also print the cycle. Input and Output Input: The adjacency matrix of a graph G(V, E). Output: The algorithm finds the Hamiltonian path of the given graph. For this case it is (0, 1, 2, 4, ... Read More
In engineering analysis, a complex mathematically modelled physical system is converted into a simpler, solvable model by employing an integral transform. Once the model is solved, the inverse integral transform is used to provide the solution in the original form. There are two most commonly used integral transforms namely – Laplace Transform and Fourier Transform. In both these transforms, a physical system represented in differential equations is converted into algebraic equations or in easily solvable differential equations of lower degree. Thus, Laplace Transform and Fourier Transform make the problem easier to solve. In this article, we will learn ... Read More
Linear SystemA system is said to be linear if it obeys the principle of homogeneity and principle of superposition.Principle of HomogeneityThe principle of homogeneity says that a system which generates an output y(t) for an input x(t) must produce an output ay(t) for an input ax(t).Superposition PrincipleAccording to the principle of superposition, a system which gives an output 𝑦1(𝑡) for an input 𝑥1(𝑡) and an output 𝑦2(𝑡) for an input 𝑥2(𝑡) must produce an output [𝑦1(𝑡) + 𝑦2(𝑡)] for an input [𝑥1(𝑡) + 𝑥2(𝑡)].Therefore, for a continuous-time linear system, [𝑎𝑦1(𝑡) + 𝑏𝑦2(𝑡)] = 𝑇[𝑎𝑥1(𝑡) + 𝑏𝑥2(𝑡)] = 𝑎𝑇[𝑥1(𝑡)] + 𝑏𝑇[𝑥2(𝑡)]Also, ... Read More
A signal is said to be periodic signal if it has a definite pattern and repeats itself at a regular interval of time. Whereas, the signal which does not at the regular interval of time is known as an aperiodic signal or non-periodic signal.Continuous Time Periodic SignalA continuous time signal x(t) is said to be periodic if and only if𝑥(𝑡 + 𝑇) = 𝑥(𝑡) for − ∞ < 𝑡 < ∞Where, T is a positive constant that represents the time period of the periodic signal. The smallest value of the time period (T) which justifies the definition of the periodic ... Read More
Race conditions, Critical Sections and Semaphores are an key part of Operating systems. Details about these are given as follows −Race ConditionA race condition is a situation that may occur inside a critical section. This happens when the result of multiple thread execution in critical section differs according to the order in which the threads execute.Race conditions in critical sections can be avoided if the critical section is treated as an atomic instruction. Also, proper thread synchronization using locks or atomic variables can prevent race conditions.Critical SectionThe critical section in a code segment where the shared variables can be accessed. ... Read More