This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Approach 1: Using Map interface | |
Map in Java stores data in the form of key-value pair. Navigable Map is an extension of Sorted Map. Navigable Map adds functions to navigate for example higherKey method which is used to get the least key strictly greater than the given key. | |
Heap means the area of memory where Java objects are stored. Heap in general is located at bottom of address space and move upwards. whenever we create object using new operator or by any another means object is allocated memory from Heap and when object dies or garbage collected, memory goes back to Heap space in Java. | |
A lock is a thread synchronization mechanism like synchronized blocks. Locks are created using synchronized blocks, so it is not like we can get totally rid of the synchronized keyword. | |
To apply lock, we would import java.util.concurrent.locks.Lock interface. | |
Algotihm: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Indexing data for fast and efficient retrieval is one of the important feture, that each application requires. I have used MongoDB to store data and Solr to index the data. Although MongoDB provides built-in full-text search capabilities but does not provide advanced indexing and search features. | |
I have used Linux OS environment for this Gist. The following softwares are required for this Gist- | |
- Java | |
- Python | |
- Apache Solr | |
- MongoDB | |
- Mongo Connector | |