Abhi
BAN USER- 0of 2 votes
Answersgiven a array of digits. print all combination of of these i.e all no formed by these.
- Abhi in India
repetition allowed.
and then for modification:
repetition not allowed
example:
i/p:
arr={2,3,4}
o/p:
(without repetition)
234
243
324
342
423
432| Report Duplicate | Flag | PURGE
Cadence Inc SDE1 Algorithm - -1of 1 vote
AnswersGiven a positive int "N". and an array of numbers ranging from 0-9 (say array name is arr).
- Abhi in India
print all numbers from 0 to N which include any number from "arr".
example:
i/p: N=20
arr={2,3}
o/p: 2,3,12,13,20| Report Duplicate | Flag | PURGE
Cadence Inc SDE1 Algorithm Coding - -1of 1 vote
AnswersWrite a script to compare two files.
- Abhi in India
One is primary file and other is secondary.
I need to check if secondary file contains each line of primary (may be in different order) and should not contain any extra data.
exmaple:
cat primary
abc
lmn
xyz
cat secondary:
cat secondary
xyz
abc
lmn
then in this case compare function should give true.
Note: file contains may be any thing like html or xml code or other.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Perl
You can call only static methods using class name like "child.add(...)" here add should be static.
rules of calling method:
1) if you create pointer of base class and store object of base class then it call method of base class.
2) if you create pointer of child class and store object of child class then it call method of child class
3) if you create pointer of base class and store object of child class then
i) if method is non virtual it call method of base class
ii) if method is virtual it call method of child class
1) Consider all ending and initial character as vertices of graph.
2)string as edge.
3) Form a directed graph
4) find "Euler path"
i) if path found concatenation all string in path.
ii) else no chain possible
eg:
1) a...d
2) q...b
3) n...f
4) a...q
5) f...a
6) d....n
Nodes will be: a b d n f q
Edged will be: 1) a->d 2) q->b 3) n->f 4)a->q 5)f->a 6)d->n
One possible path will be:
a->d->n->f->a->q->b
so chain will be:
a...d...n...f...a...q...b
Repnnelsonvance, Animator at Cognzant Technology Solutions
I am the learning and development manager and play a key role in coordinating all corporate learning and development activities ...
Replleongardner, Animator at 247quickbookshelp
I am a writer and television producer living in the Corpus Christi area. I have always been fascinated by the ...
RepEshikaLopez, general assistant at MMSS
Dedicated and reliable general assistant with background in and strong knowledge of secretarial and administrative principles. Capable of providing direct ...
This is a Tree problem.
1) Create a Tree with given values (both side of weighing scale will be consider as left node and right node)
2) The wt of each leaf node will be:
5+wt put on that side
(cuz each weighing scale has wt 10 so each side of it should be of wt 5)
3) now calculate the wt of each non-leaf node
wt of non-leaf node = Wt of left child + wt of right child + wt put on that
4) For each node calculate wt required to put onto it for balancing
wt required for balancing can be calculated from its parent node.
Go to parent node and then:
it will also cover the case where both node have same wt. in that case diff will be '0' and nothing will be added.
- Abhi October 09, 2013