Your tags "Python" and "Java" are very nice. The tell me that I can freely use some convenient pseudo-code for definition of the suitable algorithm and thus saver good deal of time. The algorithm itself can be fairly simple. Something like this:
addFlowChart(input: string; chart: FlowChart) :-
words: string[] := parseStringIntoWords(input);
node: FlowChartNode := chart.current;
for each word in words:
current.next := new FlowChartNode;
current.next.text := word;
current := current.next;
...
This algorithm will create a chain of flow chart nodes without any forks and hence without any loops. It will implement the following
relationships between nodes: for each ordered pair of nodes
A, B
, it defines if the word field in the node
B
follows that of
A
in the input text
input
. You cannot deny the fact that
this is one of the possible workflows generated by the input text input
.
What will you say? Trivial? Useless?
Not quite. In a way, my solution is very useful, if several different ways.
First of all, it should demonstrate How Useless Your Question Is.
It should help you to start thinking at the following concepts: what is Definition, Problem, Formulation of a Problem and Specification?
It should help you to Understand Logical Reasoning.
It should help you to start thinking at the following problem: How to Ask Questions in a Useful and Constructive Way.
Also, if should help you to help Picking Problems Adequate to Your Level of Skills and Knowledge.
I hope it will really help you.
—SA