LEVEL ORDER ZIG ZAG

pls check the approach else send your approach

Stack ms=new Stack<>();
ms.push(root);
int level=1;
Stack cs=new Stack<>();
while(ms.size()>0){
root=ms.pop();
System.out.println(root.data);

			if(level%2==0){
				for(int i=root.child.size();i>=0;i++){
					Node child=root.child.get(i);
					cs.push(child.data);
				}
			}
				else{
				for(int i=0;i=root.child.size();i++){
					Node child=root.child.get(i);
					cs.push(child.data);
				}

			}
		
		if(ms.size()==1){
			ms=cs;
			cs=new Stack<>();
			level++;
			System.out.println();
		}
	}
public class Solution {
    public List<List<Integer>> zigzagLevelOrder(TreeNode root) 
    {
        List<List<Integer>> sol = new ArrayList<>();
        travel(root, sol, 0);
        return sol;
    }
    
    private void travel(TreeNode curr, List<List<Integer>> sol, int level)
    {
        if(curr == null) return;
        
        if(sol.size() <= level)
        {
            List<Integer> newLevel = new LinkedList<>();
            sol.add(newLevel);
        }
        
        List<Integer> collection  = sol.get(level);
        if(level % 2 == 0) collection.add(curr.val);
        else collection.add(0, curr.val);
        
        travel(curr.left, sol, level + 1);
        travel(curr.right, sol, level + 1);
    }
}

im not able to apply your approach to my code pls help me .

sir im not able to implement the same code hep me to use the code to solve the challange

Hello are you there the ta support
you are not answering the query
im not able to write the code and use yours code pls help me
write the correct code

Please explain your query more clearly than just saying “help me cant write your code”
Bro I have given you the complete code that too which worked for me in the same question
You just need to paste it

Plus its either your code or mine
You cannot be mixing approaches
Your approach is different mine is different
You are using stack Im using linkedList

see when i copy your code im getting so much errors and im not able to rectify errors, in that way i need your help
Sir im not implement your approach

Bro why are you copying the function name as well? You need to modify it based on the template given in the question?

im copying from this line ,i think its the declaration i have to cover it ,could you pls come on teamviewer and help me to solve the question . thats the last thing i can ask you to do.
Else everytime im getting errors

im getting these errors kindly help me to rectify
those errors

ha bro because you are copying it line by line bro im not a solution guy that will spoonfeed you solutions…I am an assistant that will assist you in coming out with solutions. At the end of the day you have to make those solutions yourself.

i understmad that ,i have change the code as per required but it still need certain modifications ,
bro im trying to get code corect from 6 nov and its 9 ,Bro i tell you im not ab;e tp get a single code correct during the course .Due to lack of help

just last error i have got not able to rectify .
im fed of itseriously.

bro mera ek bhi program pure course me dng se nhi hua hh.
TA pls help me

Bro aap padhte nahi ho sahi se
agar error ko bhi padhoge to aadhe doubts solve ho jayenge
yaha pe sidha sidha keh raha hai ki isko 2 arguments chahiye aapne ek bhi nahi diya hai
To kaise chalega program