Forum Posts
- 1 Answer Printing all permutations of a String with repeated characters
I wanna print all permutations of lets say a char[] array for simplicity. This array contains a few repeated characters.
- teli.vaibhav December 17, 2013
I need to get the result without going into any previous results.
ex- say we have ['a','c','a','b']
I will print "aacb" when I encounter is the first time and I must not print it the second time, neither can I look into the previous result.| Flag | PURGE - 0 Answers Fibonacci Series
The code posted below, It's not getting compiled because of Array initialization inside class but when that's commented, code works fine. why is it so ?
- bishwas1989 December 15, 2013
class getFib
{
int[] Fib = new int[100];
Fib[0] = 0;
Fib[1] = 1;
Fib[2] = 1;
int getFib(int n)
{
int i;
int[] Fib = new int[100];
Fib[0] = 0;
Fib[1] = 1;
Fib[2] = 1;
for(i = 3; i <= n; i++)
{
Fib[i] = Fib[i-1] + Fib[i-2];
System.out.println("Fib"+"["+i+"] = "+Fib[i]);
}
return Fib[i];
}
}
class Fibonac
{
public static void main(String args[])
{
getFib f = new getFib();
System.out.println("Fibonacci Series for 2000 = "+ f.getFib(10));
}
}| Flag | PURGE - 0 Answers Time and Space complexity
Could someone tell me what the time and space complexity of an iterative + recursive algorithm would be?
- teli.vaibhav December 15, 2013
ex:-
The following code snippet prints binary sequences. i.e if n=2,
The output is
00
01
10
11
public static void printBinarySequence(int n)
{
if(n<0)
return;
int[] temp = new int[n];
printBinarySequenceAux(n,0,temp);
}
private static void printBinarySequenceAux(int n, int d, int[] temp) {
if(d==n)
{
printArray(temp);
return;
}
for(int i=0;i<=1;++i)
{
temp[d]=i;
printBinarySequenceAux(n,d+1,temp);
}
}| Flag | PURGE - 7 Answers Offer-Consumer Credit Check
Got an offer and have to consent to a consumer background check. Will having bad credit disqualify me from getting the job? What if I decline consent for consumer background check?
- CeCe December 11, 2013
Do companies recant offers of employment based on a bad credit score poor credit information?| Flag | PURGE - 0 Answers Distinct palindromic count
I want to calculate number of DISTINCT palindromic substrings in a string.How to do it?
- justhack4fun688 December 11, 2013
Like if aba is string the their are 3 distinct palindromic subsrings:{a,aba,b}
length of string could be 10^5 range.So i dont think O(n^2) solution will work.So plz help| Flag | PURGE - 0 Answers Ford Fulkerson : Backedge conditions
Hi,
- abhi1988srivastava December 11, 2013
I was going through Ford Fulkerson and there was a condition for back edge but I did not understand what is the condition for considering back edge? I can go on and on if I can consider back edge all the time.
Please some one can verify when to consider back edge..I know if there is residual capacity in the graph , I can continue but till when ?
Regards
Abhinav| Flag | PURGE - 0 Answers Ford Fulkerson : Backedge conditions
Hi,
- abhi1988srivastava December 11, 2013
I was going through Ford Fulkerson and there was a condition for back edge but I did not understand what is the condition for considering back edge? I can go on and on if I can consider back edge all the time.
Please some one can verify when to consider back edge..I know if there is residual capacity in the graph , I can continue but till when ?
Regards
Abhinav| Flag | PURGE - 0 Answers Ford Fulkerson : Backedge conditions
Hi,
- abhi1988srivastava December 11, 2013
I was going through Ford Fulkerson and there was a condition for back edge but I did not understand what is the condition for considering back edge? I can go on and on if I can consider back edge all the time.
Please some one can verify when to consider back edge..I know if there is residual capacity in the graph , I can continue but till when ?
Regards
Abhinav| Flag | PURGE - 1 Answer Verbal Confirmation of Offer, No Written Offer
I received verbal acknowledgement of offer from HR person on Thursday of last week stating that a written offer would be made Friday, but I have not heard back. I left the HR person a message on Friday, but its already Monday and I have not heard back. Would should I do?
- CeCe December 09, 2013| Flag | PURGE - 1 Answer Will we get time for preparing after applying to Google?
I'm going to apply for an internship in Google. I'm afraid I'll get contacted the very next day and my interview gets scheduled within a week.
- peanuts December 08, 2013
I need a little more time for preparation (approx. 1 month).
Can I tell them to schedule my interview in one month?
Or shall I wait one month and then apply?
I'm just afraid it will get too late because I've heard they sometimes contact their applicants even after 1 month,| Flag | PURGE - 3 Answers Question need help asap
I saw this one and i really not sure. I have an idea that takes O(n^2) but I dont like it, please suggest better:
- Dany December 05, 2013
using a log generated by a multiprocessor machine, which contains start and end time of each process, find the longest slot of time in which the machine wasn't idle.
the log is sorted by the process's start time| Flag | PURGE - 0 Answers C program
Write a complete C program that will allow you to enter and maintain a computerized version of your
- shihan.viswa December 04, 2013
family tree. Begin by specifying the number of generations (i.e. the number of lever within the tree.)
Then enter the names and nationalities in a hierarchical fashion, beginning with our own name and
nationality. Include capabilities for modifying the tree and for adding new names (new nodes) to the
tree. Also, include a provision for displaying the entire tree automatically after each update.| Flag | PURGE - 3 Answers How to delete an account?
I've emailed careercup support 5+ times already (no response) about having this account deleted. Does anyone work actively on this site at all?
- S O U N D W A V E November 27, 2013
I occasionally get emails for recent comments to questions even though I'm not subscribed to this.
The unsubscribe link in this email leads to nothing useful (as I'm not subscribed to this service to begin with).
How do I contact the people who run careercup? How to stop the sporadic spam emails?
I just got this email (which is considered spam now) :
undefined has commented on a question.
You are given an array in which you’ve to find a subarray such that the sum of elements in it is equal to zero.
He algo is nice.
However, In java it is not easy using the hashMap to get the key of values if we use hashmap(index,value). And if we want to use hashtable(value,index), the array cannot have dup as it will have the same key and cover the previous value. We can use a biMap to handle it.
if we don't want to use biMap here is my solution using two hashMap.
static void sumEqZero()
{snip}
View » | To unsubscribe, login and click here.| Flag | PURGE - 5 Answers search an element in an array where adjacent numbers differ by +1 or -1
Give an array { 5, 6 , 7, 6, 5,4,5,4,3,2,1} where each adjacent element is differ by +1 or -1, Now give an number(say 6) and nth occurrence, we need to return the index of the element?
- babusek November 26, 2013| Flag | PURGE