Conversation
Create Queue using Stacks (Sample.java)Your solution is well-implemented and follows the standard approach for this problem. Here are some points to consider: Strengths:
Areas for Improvement:
Overall, your solution is correct and efficient. Keep up the good work! VERDICT: PASS Implement Hash MapIt appears you have submitted a solution for the wrong problem. The problem was to design a HashMap, but you implemented a queue using two stacks. This is a critical error. Please review the problem statement carefully. For the HashMap problem, you need to store key-value pairs and support put, get, and remove operations. A common approach is to use an array of linked lists (chaining) to handle collisions. Each bucket in the array corresponds to a hash index, and each node in the linked list stores a key-value pair. Here are some steps to correct your solution:
You should also consider handling resizing if the number of elements grows too large, but given the constraints (at most 10^4 calls), it might not be necessary. Please reattempt the problem with the correct requirements in mind. VERDICT: NEEDS_IMPROVEMENT |
|
In the README.md file, there were two problems: Implement Queue using Stacks and Design HashMap. Previously, I had already implemented the Queue using Stacks, but I had not implemented the HashMap. Now, I have completed the HashMap implementation and also updated the Queue using Stacks section with the correct file name |
No description provided.