NEO
BAN USER- 3of 3 votes
AnswersGiven a staircase that has 'n' step, and you climb the staircase by jumping over the steps. You can cover at max of 'k' steps in a single jump. List all the possible sequence of jumps you could take to climb the staircase.
- NEO in India
input:
n=4, k=2
output:
1,1,1,1
1,1,2
1,2,1
2,1,1
2,2| Report Duplicate | Flag | PURGE
Adobe Member Technical Staff Algorithm - 0of 0 votes
Answerfind if two people are connected in social network.
- NEO in India| Report Duplicate | Flag | PURGE
Motorola SDE1 Algorithm - 0of 0 votes
Answersyou wrote a c++ program and your processor change (eg. from intel to ARM or anything ) then what are thing needs to be change in compiler to get the same behavior of program in different (eg. ARM ) architecture machine.
- NEO in India| Report Duplicate | Flag | PURGE
Motorola SDE1 Compiler Computer Architecture & Low Level - 0of 0 votes
Answersnon recursive method to calculate height of the binary tree.
- NEO in India| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 0of 0 votes
Answersyou have a dictionary which will return true if the word is present in it otherwise false. You have a string "ABC", check if anagram of "ABC" is present or not. the condition was not to generate the all the anagram of ABC. (Assumption: you can store the dictionary in trie or hashmap (any data structure) and no need to implement the dictionary)
- NEO in India| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm
use of O(n) space would give time complexity O(n). using map it can be done easily.
check below solution in c++
- NEO December 14, 2014