Skip to content

Instantly share code, notes, and snippets.

View hemantsonu20's full-sized avatar
🎯
Focusing

Hemant Patel hemantsonu20

🎯
Focusing
  • Gurgaon, India
View GitHub Profile
@hemantsonu20
hemantsonu20 / LRUCacheTTL.java
Last active November 25, 2023 08:46
LRU Cache With TTL of Keys
package com.example.demo;
import java.util.*;
class LRUCacheTTL {
private final DLL dll;
private final Queue<Node> ttlQueue;
private final Map<Integer, Node> map;
private final int capacity;
@hemantsonu20
hemantsonu20 / DelayJobScheduler.java
Created September 9, 2022 10:57
Job Scheduler With Delay
package com.example.demo;
import java.util.Queue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;