In this problem, we are given a string and we have to find all the characters that are duplicated along with their number of occurrences in the string.Let’s take an example to understand the problem −Input: TutorialsPoint Output: t (3) o (2) i (2)Explanation− The frequencies of occurrence of each character are t → 3; u → 1; o → 2; r → 1; i → 2; a → 1; s → 1; n → 1.Now, to solve this problem we will find the character count and store it in an array from the string. And then print the characters ... Read More
This article helps you to know some key features of Linux Operating systems so that you are able to choose Linux for your environment. The year 2015 and the current 2016 will be a crucial year for Linux especially in the enterprise-level segment and consumer/home users. As a Linux user since 1996, I can see that the operating systems have come a long way since 20 years. We can definitely expect more exciting times with new flavors this year.Free/Open Source Server Based OS ‘Debian/CentOS’If you are looking at running a server, but needed a free or open source server version ... Read More
Try to keep the length of lines less than 80 characters. This would make the code easier to read. Best practice is to move to next line using break if JavaScript statements aren’t fitting in a single line.In addition, move to next line only after a comma or operator. For example, you can add statement like this, with a break after operator,function display() { var a = ""; a = a + isNaN(6234) + ": 6234"; a = a + isNaN(-52.1) + ": -52.1"; a = a + isNaN('') + ": ''"; document.getElementById("test").innerHTML = a; }
Microsoft’s Surface Studio is an elegant and mature all-in-one desktop PC with built-in touch screen specially designed for creative professionals. Microsoft first release was the Microsoft PixelSense formerly called as Microsoft Surface back in 2008. The next release was the Microsoft surface tablet followed by the Surface Book. The latest upgraded release is the Surface Studio.The Studio is a 28-inch sharp, incredibly thin display mounted on a pair of “zero gravity” hinges that allows it to act as a regular monitor or tilt down into a type of drafting table. Without doubts Microsoft studio will be a clear challenge to ... Read More
In this problem, we are given an array of unique integers. And we have to return all pairs of integers(positive and negative integers) that are present in the array.Let’s take an example to understand the problem better −Input: array = {1 , 4 , 7 , -1, 2, 5, -7} Output: -11 -33An easy way to solve the problem is by using two loops and find the positive-negative pairs. But this solution will be a complex one and will have time complexity of the order n2 where n is the size of the array.But, we have to find a more ... Read More
In this problem, we are given a string of size n. And we have to print all possible palindromic permutation that can be generated using the characters of the string in alphabetical order. If palindrome is not created using the string print ‘-1’.Let’s take an example to understand the topic better −Input: string = “abcba” Output : abcba bacbaNow, to solve this we need to find all the palindromes possible and then arrange them in alphabetical order(lexicographical order). Or another way could be finding the lexicographically first palindrome that is made from the string. Then find the sequentially next palindrome ... Read More
In this problem, we are given a Binary tree and a sum S. And we have to find the path starting from root to any node of the tree, which gives the sum equal to the given sum.InputSum = 14 Output : path : 4 10 4 3 7To find the solution to this problem, we need to find the preorder traversal of the binary tree. And then find the path that adds up to the given sum.Example Live Demo#include using namespace std; struct Node{ int key; struct Node *left, *right; }; Node* insertNode(int key){ Node* temp = ... Read More
A couple of days ago, I happened to read an article where I encountered this statement-“There is nothing called free lunch.” However, I do have a soul-searching question to all the business owners – Who doesn’t like free marketing tools?Small businesses and low budget startups know the value of every penny they invest. Big brands invest BIG money every month, every hour and probably every minute on marketing. Marketing on Social Networking sites has been gaining traction since the past decade. Well, Facebook and Twitter are age-old names and world is obsessed with these two platforms. However, people are connecting ... Read More
Sed is a stream editor. A stream editor is used to participate in normal textual content transformations on an enter a file. At the same time in some approaches much like an editor which allows scripted edits (comparable to ed). sed works by means of making only one cross over on the input(s) and is more efficient. Now, let us explore more about – “Text and File processing using sed Linux Commands”.Firstly, to verify the sed version, use the following command –$ sed --vThe sample output should be like this –sed (GNU sed) 4.2.2 Copyright (C) 2012 Free Software Foundation, ... Read More
In this problem, we are given an array of unique integers and a sum. And we have to find the triplets which can form the same sum.Let's take an example to solve the problem −Input : array = {0 , 2 , -1 , 1, -2} Sum = 1 Output : 1 2 -2 0 2 -1To solve this problem, we will be finding all the triplets that provide the sum. A simple approach will be using three loops and finding the sum of the elements and return the adequate triplet.Example Live Demo#include using namespace std; void Triplets(int arr[], int ... Read More
 Data Structure
 Networking
 RDBMS
 Operating System
 Java
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP