Problem : Given a Balanced Binary Search Tree and a target sum, write a function that returns true if there is a pair with sum equals to target sum, otherwise return false. Expected time complexity is O(n) and only O(Logn) extra space can be used. Any modification to Binary Search Tree is not allowed. Note that height of a Balanced BST is always O(Logn). Solution: There are two approaches to solve the problem The Brute Force Solution is to consider each pair in BST and check whether the sum equals to X. The time complexity of this solution will be O(n^2).
Terms that are most commonly used in any microservices architecture Don't worry after watching so many new terms as below : Saga Pattern Bounded context Eventual consistency Event Command Execution Event broker CDC (change data capture) event managment Domain driven design Event driven design CQRS (Command query responsibility segregation) Rollback operation Asynchronous Callback operation Fault tolerance :Bulk Head & Circuit breaker Open API configurations Centralized logging ELK Stats aggregation Aggregates in Domain Driven Design FAT Domain VS Anemic Domain Ubiquitous Language Event sourcing Event replay Scatter-Gather Pattern Saga Pattern: A pattern which is the heart soul of any microservice architecture ,it is used to manage data consistency across multiple microservices in distributed transaction .It performs a sequence of local transactions which perform updation operation in services & publish a message or trigger the event. There are below three type of t