Jump to content

Need help - please provide c# code or logic for below questions

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
luxpriy

luxpriy

    Newbie

  • Members
  • Pip
  • 1 posts
hiiiii

Edited by luxpriy, 26 May 2010 - 09:58 AM.


#2
BuckAMayzing

BuckAMayzing

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
You should really do your homework yourself. But I can help get you pointed in the right direction for a few of these.

For 1, 3, 4, 5, 8, use stacks

For 2, store the characters in two arrays, keep a counter, compare the most recent letter entered, if it differs, return the array of characters from [0] to [counter - 1]

for 6, use the formula 2^(p-1) * (2^p - 1), where p is a prime number

for 7, there are probably a lot of different ways, but one is to just store them in arrays of size 2, then add the numbers of corresponding subscripts together, storing the results in another array of size 2. Use the '/' for a delimiter when reading the input.

for 9, I have no idea what you're asking. Are you wanting to draw the line?

for 10, sort the array, loop through, compare the numbers to a counter. When the counter differs, then that's your missing number.

for 11, google "postfix infix". It's the first result. It uses a stack too. Surprise! It really aggravates me that you didn't at least try google, so I'm gonna stop posting advice. But, since I went through the effort of posting the first few, you can have them.

#3
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
Bunch ok Geeks !! what you think people are slaves here.get me the code you have done first then let me see whether to help you or not to :D

#4
Mozana

Mozana

    Learning Programmer

  • Members
  • PipPipPip
  • 70 posts
dude where is your code, show us what you have so we know how you understand