Quote Originally Posted by djflakf1 View Post
1. Write a function to insert elements into a sorted list.

2. Write a program that reads a string, enter it into a pile and then empty the stack.

3. Write a function to scan the list of vertices and return the position of a vertex.

4. Write the following expression in infix form.
a b c + *
What are you able to use?
if you can't use stl try s.th. like this

1:
- Set i to the index of the last element in the array
- If the element to insert is larger then a[i] then insert the element at index i+1 and stop.
- Otherwise set a[i+1] = a[i] then decrease i and repeat the previous step.
- If i reaches 0, insert the element at the start.
--> http://stackoverflow.com/questions/4...on-linked-list
if you can use stl: http://www.cplusplus.com/reference/stl/list/insert/ && http://www.cplusplus.com/reference/stl/list/sort/

2:
with stl: http://www.cplusplus.com/reference/stl/stack/empty/
without stl: i don't know what pile ist (sry, english isn't my primary language) so i don't really know what to do.
Reading a string via StringBuffer or charbuffer

3:
well just iterate through you list? Compare the Stack-Place of your vertices to gain the exact position

4:
a b c + * looks like postfix notation.
so to get it to "normal" algebra we have to figure out what happens in postfix: read the wiki
so. lets begin:
okay, first thin is an a - and first operation is an * (take 1 left and 1 right)
so: a * - add braces, because of *
next is b and + so add this to our equation:
a * (b+
What's left? the c is left.
so add this
a * (b+c
close all braces:
a* (b+c)

finished ;P