
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
Found 26504 Articles for Server Side Programming

708 Views
Given a string str1 as input. The goal is to insert a ‘*’ between a pair of identical characters in the input string and return the resultant string using a recursive approach.If the input string is str1= "wellness" then output will be "wel*lnes*s"ExamplesInput − str1="happiness"Output − String after adding * : hap*pines*sExplanation − Adding * between pairs pp and ss will gives us resultant string hap*pines*sInput − str1=”swimmmmingggg pooool”Output − String after adding * : swim*m*m*ming*g*g*g po*o*o*olExplanation − Adding * between pairs mm, gg and oo will gives us resultant string swim*m*m*ming*g*g*g po*o*o*olApproach used in the below program is as followsIn this approach take string ... Read More

960 Views
To find the sample size for two sample proportion tests with given power, we can use the function power.prop.test where we need to at least pass the two proportions and power.By default the significance level will be taken as 0.05 and if we want to change it then sig.level argument will be used.Given below are some examples with the display of significance levels.Example 1Use the code given below to find the sample size for two sample proportion tests −power.prop.test(p1=8/20, p2=6/20, power=0.90, sig.level=0.05)OutputIf you execute the above given snippet, it generates the following Output for the two-sample comparison of proportions power ... Read More

592 Views
Given a Singly linked list and positive integer N as input. The goal is to find the Nth node from the end in the given list using recursion. If the input list has nodes a → b → c → d → e → f and N is 4 then the 4th node from the end will be c.We will first traverse till the last node in the list and while returning from recursion (backtracking) increment count. When count is equal to N then return pointer to current node as result.Let us see various input output scenarios for this −Input − ... Read More

383 Views
Given a Singly linked list as input. The goal is to split the list into two singly linked lists that have alternate nodes of the original list. If the input list has nodes a → b → c → d → e → f then after the split, two sub-lists will be a → c → e and b → d → f.We will take two pointers N1 and N2 one pointing to the head of the original list and another pointing to the head → next. Now move both pointers to the next of next node and create sublists.ExamplesInput − ... Read More

1K+ Views
To remove rows that have NA in R data frames stored in a list, we can use lapply function along with na.omit function.For example, if we have a list called LIST that contains some data frames each containing few missing values then the removal of rows having missing values from these data frames can be done by using the command given below −lapply(LIST,na.omit)Check out the below given example to understand how it works.ExampleFollowing snippet creates a sample data frame −df1

1K+ Views
We are given with integer values that will be used to form a linked list. The task is to firstly insert and then traverse a singly linked list using a recursive approach.Recursive addition of nodes at the endIf head is NULL → add node to headElse add to head( head → next )Recursive traversal of nodesIf head is NULL → exitElse print( head → next )ExamplesInput − 1 - 2 - 7 - 9 - 10Output − Linked list : 1 → 2 → 7 → 9 → 10 → NULLInput − 12 - 21 - 17 - 94 - 18Output − Linked list ... Read More

2K+ Views
To create boxplots based on two factor data, we can create facets for one of the factors, where each facet will contain the boxplots for the second factor.For example, if we have a data frame called df that contains two factor columns say F1 and F2 and one numerical column say Num then the boxplot based on these two factors can be created by using the below given command −ggplot(df,aes(F1,Num))+geom_boxplot()+facet_wrap(~F2)ExampleFollowing snippet creates a sample data frame −Gender

6K+ Views
To create table of two factor columns in an R data frame, we can use table function and with function.For Example, if we have a data frame called df that contains two factor columns say F1 and F2 then we can create table of these two columns by using the below command −with(df,table(F1,F2))Example 1Following snippet creates a sample data frame −Group

4K+ Views
To remove first character from column name in R data frame, we can use str_sub function of stringr package.For Example, if we have a data frame called df that contains two columns say XID and XDV then we can remove X from both the column names by using the below mentioned command −names(df)=str_sub(names(df),2)Example 1Following snippet creates a sample data frame −XColor

5K+ Views
To increase the width of the X-axis line for a ggplot2 graph in R, we can use theme function where we can set the axis.line.x.bottom argument size to desired size with element_line.Check out the below Example to understand how it can be done.ExampleFollowing snippet creates a sample data frame −x