2 questions of data structures and algorithms
Question Description
1.Implement two stacks in one array A[1..n], such that neither stack overflows unless the totalnumber of elements in both stacks together is n. The PUSH and POP operations should run in O(1)time.
2.Implement a θ(n) time non-recursive program that reverses a singly linked list L of n elements.The program gets the head of the list (L.head) as input and cannot use any storage other than thegiven list.
Code need in Java
Get your college paper done by experts
Do my question How much will it cost?Place an order in 3 easy steps. Takes less than 5 mins.
Leave a Reply
Want to join the discussion?Feel free to contribute!