Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 2075 of 2646
994 Views
Perl is a programming language developed by Larry Wall, specially designed for text processing.Just to give you a little excitement about Perl, I'm going to give you a small conventional Perl Hello World program,You can try it using the Demo link.Example Live Demo#!/usr/bin/perl # This will print "Hello, World" print "Hello, world";
2K+ Views
Perl is a programming language developed by Larry Wall, specially designed for text processing. There are following great feature of Perl LanguagePerl takes the best features from other languages, such as C, awk, sed, sh, and BASIC, among others.Perl's database integration interface DBI supports third-party databases including Oracle, Sybase, Postgres, MySQL, and others.Perl works with HTML, XML, and other mark-up languages.Perl supports Unicode.Perl is Y2K compliant.Perl supports both procedural and object-oriented programming.Perl interfaces with external C/C++ libraries through XS or SWIG.Perl is extensible. There are over 20, 000 third party modules available from the Comprehensive Perl Archive Network (CPAN).The Perl ... Read More
341 Views
Perl is a programming language developed by Larry Wall, specially designed for text processing. It stands for Practical Extraction and Report Language. It runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX Following great features make this language necessary for the Programmers to learn −Perl is a stable, cross-platform programming language.Though Perl is not officially an acronym few people used it as Practical Extraction and Report Language.It is used for mission-critical projects in the public and private sectors.Perl is an Open Source software, licensed under its Artistic License, or the GNU General ... Read More
262 Views
Problem statementGiven a binary matrix of N rows and M columns. The operation allowed on the matrix is to choose any index (x, y) and toggle all the elements between the rectangle having top-left as (0, 0) and bottom-right as (x-1, y-1). Toggling the element means changing 1 to 0 and 0 to 1. The task is to find minimum operations required to make set all the elements of the matrix i.e make all elements as 1.ExampleIf input matrix is {0, 0, 0, 1, 1} {0, 0, 0, 1, 1} {0, 0, 0, 1, 1} {1, 1, ... Read More
609 Views
Problem statementGiven a set of n integers, perform minimum number of operations (you can insert/delete elements into/from the set) to make the MEX of the set equal to x (that is given).Note − The MEX of a set of integers is the minimum non-negative integer that doesn’t exist in it. For example, the MEX of the set {0, 2, 4} is 1 and the MEX of the set {1, 2, 3} is 0ExampleIf n = 5 and x = 3 and array is {0, 4, 5, 6, 7} then we require minimum 2 operationsAlgorithmThe approach is to see that in ... Read More
551 Views
Problem statementWe are given an array of n elements. The task is to make XOR of whole array 0. We can do following to achieve this.We can select any one of the element −After selecting element, we can either increment or decrement it by 1.We need to find the minimum number of increment/decrement operation required for the selected element to make the XOR sum of whole array zeroExampleIf arr[] = {2, 4, 7} then 1 operation is required −Select element 2Decrement it by 1Now array becomes {3, 4, 7} and its XOR is 0AlgorithmFind the XOR of whole arrayNow, suppose ... Read More
130 Views
Problem statementGiven an array arr[] of positive numbers, find minimum number of sets in array which satisfy following property, A set can contain maximum two elements in it. The two elements need not to be contiguous.Sum of elements of set should be less than or equal to given Key. It may be assumed that given key is greater than or equal to the largest array element.ExampleIf arr[] = {1, 2, 3, 4} and k = 5 then following 2 pairs can be created −{1, 4} and {2, 3}AlgorithmSort the arrayBegin two pointers from two corners of the sorted array. If ... Read More
212 Views
Problem statementGiven values of A and B, find the minimum positive integer value of X that can be achieved in the equation X = P*A + Q*B, Here P and Q can be zero or any positive or negative integer.ExampleIf A = 2 and B = 4 then answer will be 2.AlgorithmWe need to find P and Q such that P*A > P*B and P*A – P*B is minimum positive integer.This problem can be easily solved by calculating GCD of both numbers)Example#include using namespace std; int getGcd(int a, int b) { if (a == 0) { ... Read More
271 Views
Problem statementYou are given an array of n integer and an integer K. Find the number of total unordered pairs {i, j} such that absolute value of |ai + aj – k| is minimal possible where i != j.ExampleIf arr[ ] = {0, 4, 6, 2, 4} and k = 7 then we can create following 5 pairs with minimal value as 1{0, 6}, {4, 2}, {4, 4}, {6, 2}, {2, 4}AlgorithmIterate over all possible pairs and for each pair we will check whether the value of (ai + aj – K) is smaller than our current smallest value of ... Read More