Friday, 6 February 2015
Socket Programming with Multiple Thread
Given two strings a and b, find whether any anagram of string a is a sub-string of string b
Code a function that receives a string composed by words separated by spaces and returns a string where words appear in the same order but than the original string, but every word is inverted
Write a program to expand a given string x to y?
pattern 5
pattern 4
pattern 3
pattern 2 program
pattern program 1
Create a Single Linked List program using C
#include
struct Node
{
int data;
struct Node *next;
};
struct Node *create_list(int *ptr,int n)
{
struct Node *hptr=NULL,*tptr,*temp;
int i;
if(n>0)
{
hptr=(struct Node*)malloc(sizeof(struct Node));
tptr=hptr;
hptr->data=ptr[0];
for (i=1;idata=ptr[i];
temp->next=NULL;
tptr->next=temp;
tptr=temp;
}
}
return hptr;
}
void display(struct Node *dptr)
{
struct Node *temp;
for (temp=dptr;temp!=NULL ;temp=temp->next )
{
printf("%d\n",temp->data);
}
}
struct Node *getNfromLast(struct Node *hptr,int n)
{
struct Node *fptr,*bptr;
int i;
fptr=hptr;
bptr=hptr;
for (i=0;inext;
while(fptr->next!=NULL)
{
fptr=fptr->next;
bptr=bptr->next;
}
return bptr;
}
void main()
{
int arr[]={1,2,3,4,5,6};
struct Node *hptr,*tptr;
hptr=create_list(arr,6);
display(hptr);
tptr=getNfromLast(hptr,3);
printf("\n%d\n",tptr->data);
}
Create a Single Linked List using array and find an element in the list
Find count the number of occurrence of Strings in a Sentence?
Thursday, 29 January 2015
Find the Binary Or in Strings using Java
Write a Program for Client and Server communication in java
Wednesday, 7 January 2015
Write an algorithm to convert the given input string to the expected output string. The input string shall be the length of few million characters. So the output has to be updated in the same string...
Input String = "ABBCDEFGGGGGGGGHHXX Expected output = "A1B2C1D1E1F1G8H2X2
Given a large array of unsigned ints, quickly find two who's sum is 10
Illustrate with an example the difference between deep and shallow copy in java?
change the value of the i without changing code of the main function, assign 20 to i ?
Find the unique number that is present only once in array while all the others are present three times.
Example: 2,3,5,1,2,2,5,3,5,3 Answer : 1 as 2,3,5 are repeated three times Complexity should be better than O(nlogn)
Subscribe to:
Posts (Atom)