문제

I have to write a program which will find the lowest common ancestors but I have to use stack and queue. I am trying to learn on my own and just solving all the interview questions from the web can anyone help me get started? just need a template and I can fill out the meat of the program.

도움이 되었습니까?

해결책

To implement your stack and queue you can use a simple array. The array object in javascript has commands like push(sth) or pop().

For more informations, take a look @ http://www.w3schools.com/js/js_obj_array.asp

Also check this out: How do you implement a Stack and a Queue in JavaScript?.

I hope you can start from here. learning by doing is the best way to learn sth. ;)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top