## vishgupta92

BAN USER- 2of 4 votes

AnswersGenerate all possible sorted arrays from alternate elements of two given sorted arrays.

- vishgupta92 in United States

Given two sorted arrays A and B, generate all possible arrays such that once first element is taken from A then from B then from A and so on in increasing order till the arrays exhausted. Then first element is taken from B then From A, and do same as above.| Report Duplicate | Flag | PURGE

Microsoft Software Engineer Algorithm

please tell me for that situation can dx or dy be negative as it'll follow dx+dy=k,

i.e dy will be more than k and dx will negative of difference of dy and k.

As per my knowledge trie store from the first character to last character in different level of trie, now please tell how "my" keyword will be find when it will come in as substring not from front.

please reply!!!

Where you have taken input as Jerry Position???

And please also tell me how distance formula will work here because there may be many block cell will be in the direct path between them??

make correction - hammingWeight[i] should be arr[i]

- vishgupta92 August 01, 2015Incorrect Solution!!! :(

- vishgupta92 August 01, 2015when array A (first) is taken first then.

10 15

10 15 20 30

10 15 20 35

10 15 30 35

10 20

10 20 30 35

10 30

10 35

20 30

20 35

30 35

when array B (second) is taken first then.

5 10

5 10 15 20

5 10 15 30

5 10 20 30

5 20

5 30

15 20

These are all outputs for your test case.

can you please provide the whole code or exaplain more clearly.

- vishgupta92 July 31, 2015Your Idea is Good, Please also tell me that how will you find Kth Rank Word from TreeMap?

- vishgupta92 July 13, 2015Following are some simpler versions of the problem:

If given Tree is Binary Search Tree?

If the given Binary Tree is Binary Search Tree, we can store it by either storing preorder or postorder traversal. In case of Binary Search Trees, only preorder or postorder traversal is sufficient to store structure information.

If given Binary Tree is Complete Tree?

A Binary Tree is complete if all levels are completely filled except possibly the last level and all nodes of last level are as left as possible (Binary Heaps are complete Binary Tree). For a complete Binary Tree, level order traversal is sufficient to store the tree. We know that the first node is root, next two nodes are nodes of next level, next four nodes are nodes of 2nd level and so on.

If given Binary Tree is Full Tree?

A full Binary is a Binary Tree where every node has either 0 or 2 children. It is easy to serialize such trees as every internal node has 2 children. We can simply store preorder traversal and store a bit with every node to indicate whether the node is an internal node or a leaf node.

How to store a general Binary Tree?

A simple solution is to store both Inorder and Preorder traversals. This solution requires requires space twice the size of Binary Tree.

Following are some simpler versions of the problem:

If given Tree is Binary Search Tree?

If the given Binary Tree is Binary Search Tree, we can store it by either storing preorder or postorder traversal. In case of Binary Search Trees, only preorder or postorder traversal is sufficient to store structure information.

If given Binary Tree is Complete Tree?

A Binary Tree is complete if all levels are completely filled except possibly the last level and all nodes of last level are as left as possible (Binary Heaps are complete Binary Tree). For a complete Binary Tree, level order traversal is sufficient to store the tree. We know that the first node is root, next two nodes are nodes of next level, next four nodes are nodes of 2nd level and so on.

If given Binary Tree is Full Tree?

A full Binary is a Binary Tree where every node has either 0 or 2 children. It is easy to serialize such trees as every internal node has 2 children. We can simply store preorder traversal and store a bit with every node to indicate whether the node is an internal node or a leaf node.

How to store a general Binary Tree?

A simple solution is to store both Inorder and Preorder traversals. This solution requires requires space twice the size of Binary Tree.

It looks like the Strassen's Matrix Multiplication problem..

- vishgupta92 July 07, 2015BaseAddress + sizeof(typeofArray)*( TotalNoOfColumns*X + Y)

this is a 2D array formula where X & Y desire position rowth and column

We can also simulate this problem into Graph, Where its Vertices are the dial Number(2,3,4,....9) and edges are{{2 -> A,B,C}, {3 ->D,E,F}.........}

and using the traversing Techniques it can print all possible permutation.

if m wrong plz give any suggestions

Do you Know the meaning of Large?

- vishgupta92 June 12, 2015#include<iostream>

using namespace std;

int main(){

int ar[1000],length,i,rightshift,temp;

cin>>length>>rightshift;

for(i=0;i<length;i++)

cin>>ar[i];

rightshift%=length;

for(i=0;i<length/2;i++){

temp=ar[i];

ar[i]=ar[(i+rightshift)%length];

ar[(i+rightshift)%length]=temp;

}

for(i=0;i<length;i++)

cout<<ar[i]<<" ";

return 0;

}

Rep**jacobghester2**, Accountant at ASAPInfosystemsPvtLtdI'm an artist at heart. I went from print design to web development and lots of server administration professionally ...

RepI am randy, 29 year old and I am doing a job. I am doing a job as a plant ...

Rep**ryandchinkle**, Android Engineer at ABC TECH SUPPORTI was born in Northridge USA, I like photography, I have wide photos collection of wildlife. I have many religious ...

Rep**jasonmcarrier**, Analyst at Abs india pvt. ltd.Hello, I live in Houston and I am working as a Convention planner in Roberd's company, I also part ...

Rep**johndbutler0**, Aghori Mahakal Tantrik at BMO Harris BankI consider myself to be driven, proactive, hard working, a team player, creative and absolutely passionate person! I am strong ...

Rep**samuelcsmith700**, Accountant at Absolute Softech LtdJe suis chef d'équipe de support Office dans une entreprise Action Auto. Je suis également rédacteur de blog. J ...

Rep**sonjamramos45**, Graphics Programmer at CGI-AMSI am a strong writer with a passion for story-telling who has extensive experience of writing literary compositions, articles, reports ...

Rep**alicesreedg**, Accountant at ADPHi my name is Alice and i am working in an IT company. I am working here from last 5 ...

Rep**jonesreina93**, Hawaiian airlines reservations at American AirlinesHello, I am currently working at the airport as an air hostess, and my responsibility are Check tickets and assisted ...

Rep**nancyhfloress**, Computer Scientist at AMDHey there, I’m Nancy. I’m a small business owner living in Sunrise, FL 33323. I am a fan ...

Rep**paulinedsisk**, Testing / Quality Assurance at Cloudmere, Inc.I want to become a successful professional in a highly competitive technological world where performance is rewarded with exciting new ...

Rep**loreleijhansen**, Aghori Mahakal Tantrik at ABC TECH SUPPORTI am Lorelei.I am working in a store as a Bonus clerk promoting the development, and implementation and solutions ...

Rep**susanaminick**, Research Scientist at CapitalIQI am Susan from Dallas, I am working as a Property manager in Kohl's Food Stores company. I love ...

Rep**nancysimms14**, Backend Developer at ASAPInfosystemsPvtLtdI am Nancy from California,Handling project development and documentation is my job. Passionate determined.Looking for an open project ...

Rep**mitadwilson**, Scientific Officer at Cleartrip.comHello, I am Mita from Dayton, I am working as a Systems programmer in Evans company, I have Experience of ...

Rep**floydmsnyder**, Theoretical mathematician at STM Auto PartsAs a Theoretical Mathematician,I’m little more interested in the theory involved with mathematics. In my free time , I ...

Rep**annarrathjen**, Employee at 247quickbookshelpHello, My name is Anna and I am a medical records technician with 2 years of experience and achievements. I ...

Rep**SarahSKelly**, Game Programmer at AkamaiI am Professor, and I am also a skilled fiction writer. I have a collection of novels published in the ...

Rep**GretaHLopez**, abc at ASAPInfosystemsPvtLtdHello, I am Greta and I am working as a GIS specialist who often works for state or local governments ...

Rep**kennypmillerk**, AT&T Customer service email at 247quickbookshelpMy name is Kenny and I am working as a trusted investor in Pittsburgh USA.I identify / set up a ...

Rep**alicegpopa**, Apple Phone Number available 24/7 for our Customers at AMDI am working as a U.S. marshal in Pro Property Maintenance. I want to write about I Want My ...

Rep**pathfisher**, Animator at Rack N SackI am Pat working in Rack N Sack where I use sequential images to produce the illusion of movement and ...

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window

- vishgupta92 August 17, 2015