1. is a DCFL
See here we donot know the value of m,n,p,q. So, first start pushing a, then pop a by b. After poping all a's if more a remain in stack, start pushing b and then push c. After that when d comes in stack start poping until queue becomes empty.
2. is a DCFL
Here push a, Now pop a by b. If there are more number of b than a, then after poping all a's remaining b should be push into the stack. Now, when c comes start poping b by c and after poping all b's if more c remain start pushing those c's. Then d comes and pop all remaining c's