Server Side Programming Articles

Page 1583 of 2109

Minimum number of basic logic gates required to realize given Boolean expression`

Divya Sahni
Divya Sahni
Updated on 25-Jul-2023 1K+ Views

Logic gates are the basic building block of a digital circuit. They take in one or two binary inputs and return a binary output. Since, using the term binary, the output and input can either be 0 or 1 or it can be said as “false” and “true” or “low” and “high”. There are 3 basic logic gates − AND Gate AND gate has two or more inputs and one output. It produces a high output if all inputs are high. The truth table for a two-input AND gate is given below − Input 1 Input 2 Output ...

Read More

Check if it is possible to reach any point on the circumference of a given circle from origin

Divya Sahni
Divya Sahni
Updated on 25-Jul-2023 191 Views

The circumference of a circle can be defined as the outer boundary of the circle. It is the perimeter of a circle. Each point around a circle follows certain properties as follows − Point (x, y) lying inside the circle such that, $\mathrm{x^2 + y^2 < R^2}$ Point (x, y) lying on the circle such that, $\mathrm{x^2 + y^2 = R^2}$ Point (x, y) lying outside the circle such that, $\mathrm{x^2 + y^2 > R^2}$ where R = radius of the circle. Problem Statement Given a string S representing a sequence of moves (L, R, U, D) and ...

Read More

Check if a given string is a comment or not

Divya Sahni
Divya Sahni
Updated on 25-Jul-2023 3K+ Views

In computer programming, comments are text written with the source code but ignored by the compiler or interpreter. They are used to provide readability of code by describing the code and its functionality for someone who is reading the code other than a compiler or interpreter. They are not executed and do not affect the functionality of the overall program, they are just for programmer guidance. Each programming language has a different syntax to represent comments. Here are a few examples − C/C++ − In C or C++, single-lined comments begin with ‘//’ and multi-liner comments are enclosed in ...

Read More

Sum of Pairwise Products

Divya Sahni
Divya Sahni
Updated on 25-Jul-2023 2K+ Views

The pairwise product of a set X = {a, b, c} can be defined as the sum of the product of all possible set pairs. The pairs of the set are, Y = {a * a, a * b, a *c, b * b, b * c, c * c}, where the product is commutative. Thus, the pairwise product of set X is the summation of elements of set Y i.e. aa + ab + ac + bb + bc + cc. In mathematical terms, the sum of possible pair products can be depicted as, $$\mathrm{\displaystyle\sum\limits_{i=1, j=i}^{i\leq n, j\leq n}\:(i, ...

Read More

Golomb sequence

Divya Sahni
Divya Sahni
Updated on 25-Jul-2023 1K+ Views

Golomb Sequence − The Golomb Sequence is a non-decreasing sequence of integers where the value of the nth term is the number of times the integer n appeared in the sequence. Some terms of Golomb sequence are, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, … Here as we can see, the 5th term is 3 and 5 also appears 3 times in the sequence. The 6th term is 4 and 6 also appears 4 times in ...

Read More

Front and Back Search in unsorted array

Divya Sahni
Divya Sahni
Updated on 25-Jul-2023 454 Views

Unsorted Array − An array is a data structure consisting of a collection of elements of the same type. An unsorted array is such a structure where the order of elements is random, i.e. on insertion, the element is added to the last irrespective of the order of previous elements and searching in such an array is not helped by any search algorithm because of lack of a pattern of the positioning of elements. Searching − Searching in an array means finding a particular element in the array which can be either returning the position of a desired element or ...

Read More

Find n-th Fortunate Number

Divya Sahni
Divya Sahni
Updated on 25-Jul-2023 314 Views

Fortunate Numbers − It is the smallest integer m > 1 such that, for a given positive integer n, pn# + m is a prime number, where pn# is the product of the first n prime numbers. For example, for calculating the third fortunate number, first calculate the product of the first 3 prime numbers (2, 3, 5) i.e. 30. Upon adding 2 we get 32 which is an even number, adding 3 gives 33 which is a multiple of 3. One would similarly rule out integers up to 6. Adding 7 gives, 37 which is a prime number. Thus, ...

Read More

Check if any valid sequence is divisible by M

Divya Sahni
Divya Sahni
Updated on 25-Jul-2023 258 Views

A sequence is a collection of objects, and in our case, it is a collection of integers. The task is to find if a sequence with the usage of the addition and subtraction operator within the elements is divisible by M or not. Problem Statement Given an integer M and an array of integers. Using only addition and subtraction between elements check if there is a valid sequence whose solution is divisible by M. Sample Example 1 Input: M = 2, arr = {1, 2, 5} Output: TRUE Explanation − For the given array a valid sequence {1 ...

Read More

Golang program to calculate the symmetric difference between two slices

Akhil Sharma
Akhil Sharma
Updated on 24-Jul-2023 644 Views

Slice is similar to an array, the only difference is that an array is a fixed sequence of elements whereas slice the array elements are dynamic. This makes the slice more efficient and faster in various applications. In the slice, the elements are passed by reference instead of values. In this article, we are going to learn about different techniques to calculate the symmetric difference between two slice using Golang programming. Algorithm Step 1 − Create a package main and declare fmt(format package) package in the program where main produces executable codes and fmt helps in formatting input and ...

Read More

Characteristics of .NET Framework

Siva Sai
Siva Sai
Updated on 24-Jul-2023 4K+ Views

In the realm of software development, Microsoft's .NET Framework has revolutionized the industry with its comprehensive and consistent programming model for creating applications that have visually stunning user experiences, seamless and secure communication, and the ability to model a range of business processes. This article seeks to highlight the key characteristics of the .NET Framework that make it a vital tool for developers worldwide. What is .NET Framework? The .NET Framework, a software framework developed by Microsoft, is a platform for building various types of applications. From Windows-based applications to web-based applications and services, the .NET Framework provides a large ...

Read More
Showing 15821–15830 of 21,090 articles
Advertisements