staking rand alpha

Can someone show me how to stalk a random alpha letter in order in a minimum possible way.. and write the cases which the container can be stalked.

for example.. ACMICPC can be a store in three stalks.
ACC
M -----------> three stalks
IP
Another example... CBACBACBACBACBA can have three stalks
Last edited on
help
It's not at all clear from your example what exactly a "stalk" is. Why would M have 3 stalks but "ACC" only has 1?

And "ACC" wasn't even in the original string, so where did it come from?

And why would CBACBACBA have 3 stalks?
Last edited on
no the ACMICPC has 3 stalks and below that is the example I showed how ACMICPC has 3 stalks

CBACBACBA have 3 stalks because when you stalk them in order, it would be
cccc
bbbb
aaaa
I don't know if that make sense.

for the program, it is like a container arrives randomly and, the programming should take that data, and stalk the box(in this case the Alphas) in order in a minimum possible way.

Is it clear?
Last edited on
Do you mean stack when you say stalk?
yes, sorry I miss spelled that
The ACMICPC has 3 stacks and below that is the example I showed how ACMICPC has 3 stacks

CBACBACBA have 3 stacks because when you stack them in order, it would be
cccc
bbbb
aaaa
I don't know if that make sense.

for the program, it is like a container arrives randomly and, the programming should take that data, and stack the box(in this case the Alphas) in order in a minimum possible way.

Is it clear?
So, you have a sequence of objects, that you need to be stacked. You've given us no information about the restraints you must operate under when this is done. In other words, there is not nearly enough information to provide you with a reasonable response.

Your problem may fall under the purview of a bin packing algorithm. You may want to google that and see if it can be of use to you.

This doesn't seem to have anything to do with C++.
it is C++, I have a picture of the output as an example.. I don't know how to post it in here
CBACBACBA have 3 stacks because when you stack them in order, it would be
cccc
bbbb
aaaa


So 1 letter is 1 stack? So basically you are counting the number of unique characters?

The ACMICPC has 3 stack


This still confuses me. ACMICPC has 5 unique letters (ACIMP) so why would it only have 3 stacks?
you can stack another pack on top of the other one if there are only one type and the one after is greater alpha..ACMICPC has only one A, and when you check through, can't find another A, so the compiler moves to the the next box which is C, it checks if C >A if so it stacks it on top of A, Then moves to M, Yes M is < C but it can not stack it on top of C for there are other C's on the data(container) that has not been processed, so it creates another stack.
on the other hand if it was,
for example
ACMICPCA then this would have 4 stack because C can not be stack on top of A since there is an A data that is not been processed
AA
CCC
M
IP

does this make sense.. it is a bit hard to explain on here
Okay I understand now.

Also... as a side effect of explaining the process to me,... you also have explained exactly what you need to do to accomplish this in a program. You laid out the step-by-step logic in your post... now all you need to do it take each of those steps and write the code for it.

So in explaining this... maybe you have answered your own question?
Last edited on
i do have understanding of the problem, but whenever i try to do the code, i get stuck
Topic archived. No new replies allowed.