Pergunta de entrevista da empresa Pratham

What is the difference between an array and a linked list? Explain the concept of a hash table and its applications. How do you find the middle element of a singly linked list in one pass? Explain Depth-First Search (DFS) and Breadth-First Search (BFS) algorithms. Implement a binary search algorithm for a sorted array. What is dynamic programming? Provide an example of a problem that can be solved using dynamic programming. Explain the concept of time complexity and space complexity. How do you detect a cycle in a directed graph? Implement a stack using an array and describe its operations. What is the difference between a queue and a stack? Provide real-life examples of their applications.