## Tag: Amazon Interview Questions

### Rearrange the linked list separately from the odd nodes and even nodes

November 8, 2018
Prequesite:- Singly Linked list  Problem :- You are given with an linked list. Write a program to print the odd nodes containing the odd elements followed by the even nodes with even elements. The result should contain a single linked list. The time complexity should be  O(n) where 'n' is ...

### Robin-Karp String Searching Algorithm

September 23, 2018
Problem Statement: Write an efficient algorithm for matching the pattern given by the user in a string. If the pattern exists print the starting indexes in the string else return 1.   Method 1- Brute Force Approach Lets us look what is problem with the Brute-Force Approach for the string matching Let the length ...

### Sliding Window Maximum Algorithm

September 18, 2018
Sliding Window Maximum Algorithm (To track the maximum of each subarray of size k) Problem:- Write an algorithm to track the maximum of each subarray of size k in time complexity O(n) and space complexity O(k),  where n is the size of the array and k is size of the window ...