Here you have to first sort both the arrays A and B and merge both the
arrays to form the sorted array C
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus)
*--*
sapraaks...@gmail.com
akshatsapr...@gmail.com
rit20009008@ rit20009
to output the minimum number of jumps that can be made from
starting position to end position of an array.
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus)
*--*
sapraaks...@gmail.com
akshatsapr...@gmail.com
rit20009008@ rit20009
tree as per given in the tutorial and
find the frequent patterns.
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus)
*--*
sapraaks...@gmail.com
akshatsapr...@gmail.com
rit20009008@ rit20009...@gmail.comiiita.ac.in
--
You received
There is no need to use any other data structure or sort the array one can
directly construct the BST from a given array by taking one element at a
time from the beginning and inserting into a BST.
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus
Using Two Mallocs :
int *data;
int **arr;
data = malloc(sizeof(int) * nrows * ncols );
arr = malloc(sizeof(int*) * nrows);
for ( int i = 0; i nrows; i++) {
arr[i] = data[ i * ncols ];
}
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus
Apply DFS in the trie
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus)
*--*
sapraaks...@gmail.com
akshatsapr...@gmail.com
rit20009008@ rit20009...@gmail.comiiita.ac.in
--
You received this message because you are subscribed
== '#' ) {
stk.pop();
postfix[j] = stk.top();
j++;
stk.pop();
}
stk.push('#');
}
}
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus
To do this question in O(n) time follow the post Segment trees in this
post of topcoder
http://community.topcoder.com/tc?module=Staticd1=tutorialsd2=lowestCommonAncestor
Here in this given algorithm preprocessing time in O(n) and query time is
O(log n).
--
Akshat Sapra
Under Graduation
void make_group( int a[], int size) {
int j = 0;
for ( int i = 0; i size; i++ ) {
if ( a[i] 0 ) {
swap(a[i],a[j]);
j++;
}
}
}
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus
int low,mid,high;
low = mid = 0;
high = (int)(sizeof(arr)/sizeof(arr[0]))-1;
/*
According to Dutch national flag problem there are three types of
quantities in an array and we have to combine these elements together
but in
sorry for the above post , there was careless mistake of mine. The code
will be
[code]
int low,mid,high;
low = mid = 0;
high = (int)(sizeof(arr)/sizeof(arr[0]))-1;
/*
According to Dutch national flag problem there are
[arr[i]] max_till_now ) max_till_now =
hashmap[arr[i]];
}
print(max_till_now);
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus)
*--*
sapraaks...@gmail.com
akshatsapr...@gmail.com
rit20009008@ rit20009...@gmail.comiiita.ac.in
--
You
Solution:
arr[n],sum = 0;
for ( int i = 0 ; i n; i++ ) {
sum ^= arr[i];
}
print sum; // required number
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus)
--
sapraaks...@gmail.com
akshatsapr...@gmail.com
rit2009...@iiita.ac.in
= end-next;
}
while ( end != start )
}
call the functions two times
inverse(0th node,n-1th node);
inverse(nth node, list.size()th node);
--
Akshat Sapra
Under Graduation(B.Tech)
IIIT-Allahabad(Amethi Campus)
--
sapraaks...@gmail.com
akshatsapr
: By Pointer to array we means that there is a pointer
that is defined to point to some index in an array.
Example:-
There is some array arr and we define a pointer a;
int *a = arr;
then this points to value arr[0];
and if int *a = arr+9;
then this points to value arr[9];
--
Akshat Sapra
Under
to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Akshat Sapra
16 matches
Mail list logo