vishgupta92
BAN USER
- 3of 5 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;
}
Repjacobghester2, Accountant at ASAPInfosystemsPvtLtd
I'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 ...
Repryandchinkle, Android Engineer at ABC TECH SUPPORT
I was born in Northridge USA, I like photography, I have wide photos collection of wildlife. I have many religious ...
Repjasonmcarrier, 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 ...
Repjohndbutler0, Aghori Mahakal Tantrik at BMO Harris Bank
I consider myself to be driven, proactive, hard working, a team player, creative and absolutely passionate person! I am strong ...
Repsamuelcsmith700, Accountant at Absolute Softech Ltd
Je suis chef d'équipe de support Office dans une entreprise Action Auto. Je suis également rédacteur de blog. J ...
Repsonjamramos45, Graphics Programmer at CGI-AMS
I am a strong writer with a passion for story-telling who has extensive experience of writing literary compositions, articles, reports ...
Repalicesreedg, Accountant at ADP
Hi my name is Alice and i am working in an IT company. I am working here from last 5 ...
Repjonesreina93, Hawaiian airlines reservations at American Airlines
Hello, I am currently working at the airport as an air hostess, and my responsibility are Check tickets and assisted ...
Repnancyhfloress, Computer Scientist at AMD
Hey there, I’m Nancy. I’m a small business owner living in Sunrise, FL 33323. I am a fan ...
Reppaulinedsisk, 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 ...
Replyndaander9, Analyst at A9
My name is Anderson and I am a 24 years old trader born and currently working in New York, USA ...
Reploreleijhansen, Aghori Mahakal Tantrik at ABC TECH SUPPORT
I am Lorelei.I am working in a store as a Bonus clerk promoting the development, and implementation and solutions ...
Repsusanaminick, Research Scientist at CapitalIQ
I am Susan from Dallas, I am working as a Property manager in Kohl's Food Stores company. I love ...
Repnancysimms14, Backend Developer at ASAPInfosystemsPvtLtd
I am Nancy from California,Handling project development and documentation is my job. Passionate determined.Looking for an open project ...
Repmitadwilson, Scientific Officer at Cleartrip.com
Hello, I am Mita from Dayton, I am working as a Systems programmer in Evans company, I have Experience of ...
Repmarisamsan7, Cloud Support Associate at ADP
Hi, I am Photoengraver from an CO,USA. I am a girl with a strong desire to travel the world ...
Repfloydmsnyder, Theoretical mathematician at STM Auto Parts
As a Theoretical Mathematician,I’m little more interested in the theory involved with mathematics. In my free time , I ...
Repannarrathjen, Employee at 247quickbookshelp
Hello, My name is Anna and I am a medical records technician with 2 years of experience and achievements. I ...
RepSarahSKelly, Game Programmer at Akamai
I am Professor, and I am also a skilled fiction writer. I have a collection of novels published in the ...
RepGretaHLopez, abc at ASAPInfosystemsPvtLtd
Hello, I am Greta and I am working as a GIS specialist who often works for state or local governments ...
Repkennypmillerk, AT&T Customer service email at 247quickbookshelp
My name is Kenny and I am working as a trusted investor in Pittsburgh USA.I identify / set up a ...
Repalicegpopa, Apple Phone Number available 24/7 for our Customers at AMD
I am working as a U.S. marshal in Pro Property Maintenance. I want to write about I Want My ...
Reppathfisher, Animator at Rack N Sack
I am Pat working in Rack N Sack where I use sequential images to produce the illusion of movement and ...
RepWandaScales, Applications Developer at Aspire Systems
I am a Medical writer in the Just For Feet company . I enjoy spells for making someone obsessed with you ...
RepHelanZelda, Consultant at Advent
HelanZelda from Atlanta, GA, United States. I have a passion for exploring/sharing new ideas and experiences throughout the interdisciplinary ...
- vishgupta92 August 17, 2015