Reverse a String
Introduction Reversing a string is a common task in programming that involves rearranging the characters of the string so that they appear in the opposite order. This operation can be…
Find Sum of Diagonal Elements in a Matrix
Introduction In a square matrix, the diagonal elements are those that extend from the top left corner to the bottom right corner. For example, in a n×nn \times nn×n matrix,…
Upper and Lower Triangular Matrix
Introduction In linear algebra, triangular matrices are special types of square matrices. An upper triangular matrix is a matrix in which all the entries below the main diagonal are zero.…
Check Symmetric Matrix
Introduction A symmetric matrix is a square matrix that is equal to its transpose. In other words, for a matrix AAA to be symmetric, it must satisfy the condition A=AA…
Matrix Multiplication
Introduction Matrix multiplication is a fundamental operation in linear algebra where two matrices are multiplied to produce a third matrix. This operation is crucial in various applications, including computer graphics,…
search an elements in an array (linear search)
Introduction Linear search is a straightforward algorithm for finding a specific value within an array. It sequentially checks each element until the desired value is found or the end of…
Binary Search
Introduction Binary search is an efficient algorithm for finding a specific value in a sorted array. It works by repeatedly dividing the search interval in half. If the value of…
Matrix addition
Introduction Matrix addition is a fundamental operation in linear algebra where two matrices of the same dimensions are added together by adding their corresponding elements. This operation is commonly used…
Matrix subtraction
Introduction Matrix subtraction is an operation that involves subtracting the corresponding elements of two matrices of the same dimensions. This operation is widely used in fields such as computer graphics,…
Transpose of a Matrix
Introduction Transposing a matrix is an important operation in mathematics and computer science. It involves converting the rows of a matrix into columns and the columns into rows. For example,…