Linked List
Types of Linked List
Singly Linked List
Doubly Linked List
Circular Linked List
Circular Doubly List
Skip list in DS

DS Queue
Types of Queues
Array Representation
Linked List Representation
Circular Queue
Deque
Priority Queue

Bubble Sort
Bucket Sort
Comb Sort
Counting Sort
Heap Sort
Insertion Sort
Merge Sort
Quick Sort
Radix Sort
Selection Sort
Shell Sort
Bitonic Sort
Cocktail Sort
Cycle Sort
Tim Sort

Linear vs non-linear
Array vs linked list
Stack vs queue
Linear vs Circular Queue
Linear Search vs Binary Search
Singly Linked List vs Doubly Linked List
Binary vs Binary Search Tree
Tree vs Graph
Binary Search tree vs AVL tree
Red Black Tree vs AVL tree
B tree vs B+ tree
Quick Sort vs Merge Sort
BFS vs DFS
Stack vs Heap
Bubble sort vs. Selection sort
Stack vs Array
Full Binary Tree vs Complete Binary Tree
Binary Tree vs B Tree
Primitive vs non-primitive data structure
Data types vs data structure

Trie Data Structure
Heap Data Structure
Splay Tree
Fundamental of the DS
Hash Table
Preorder Traversal
Tree Traversal
Implementation of Queue using Stacks
Implementation of Stack using Queue
Binomial Heap
Postorder Traversal
Sparse Matrix
Detect loop in a Linked list
Inorder Traversal
Convert Infix to Postfix notation
Convert infix to prefix notation
Conversion of Prefix to Postfix expression
Conversion of Postfix to Prefix expression
Remove the loop in a Linked List
Implement two stacks in an array
Reverse a stack using recursion
Detect cycle in a directed graph
Optimal Binary Search Tree
Priority Queue using Linked list
Balanced Binary Search Tree
Boundary Traversal of Binary tree
Diagonal Traversal of Binary Tree
Vertical Traversal of a Binary tree
Graph Algorithms
Time Complexity of Sorting Algorithms
Applications of Stack in Data Structure
Dictionary Data Structure
Structured Data and Unstructured Data
List Data Structure
Types of Tree in Data Structure
Abstract data type in data structure
Disjoint set data structure
Dynamic Data Structure
Hash Function in Data Structure
Complete Binary Tree
Threaded Binary Tree
Diameter of Binary Tree
Height of Binary Tree
Inorder Tree Traversal without Stack
Enumeration of Binary Trees
Maximum Width of a Binary Tree
Types of Graph in Data Structure
Primitive Data Type
Semi-Structured Data
Advance Data Structures
Sort an Array of 0's, 1's, and 2's
Stock Span Problem
Implementation of Deque by Circular Array
Rotate Operation in Linked List
Subarray with given sum
Self-organizing List
Unrolled Linked List
Types of Sparse Matrices
Application of Linked List
Topological Sorting
Ternary Search Tree
Stock Span Problem
Treap Data Structure
Quicksort on Doubly Linked List
Inversion count
Expression tree in DS
Garbage Collection in DS
Merge Sort on Doubly Linked List
Sort Stack using Recursion
LIFO Approach in data structure
Big O Notation in DS
Binary Tree Traversal in DS
Queue Operations in DS
What is a Non-Linear Data Structure
FIFO Approach in data structure
What are connected graphs in data structure
Which Python data structure is immutable
Which data structure is used by map
What is iteration in data structure
What are linear search and binary search in data structure
Hash Table vs STL Map
Recaman's Sequence
Maximum area rectangle created by selecting four sides from an array
Maximum number of distinct nodes in a root-to-leaf path
Hashing - Open Addressing for Collision Handling
Introduction to Hashing
Separate chaining for Collision Handling
Check if a given array contains duplicate elements within k distance from each other
Given an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)
Find number of Employees Under every Manager
Union and Intersection of two Linked Lists
Kth Largest element in an array
Sort an almost-sorted, k-sorted or nearly-sorted array
Fibonacci Heap
Find whether an array is subset of another array
Print a Binary Tree in Vertical Order
Tournament Tree (Winner Tree)
Lazy Propagation in Segment Tree
Segment Tree - Range Minimum Query
Segment Tree - Sum of given Range
2-3 Trees (Search, Insertion, and Deletion)
Print kth least significant bit of a number
Add two numbers represented by linked lists
Adding one to the number represented as array of digits
Find precedence characters form a given sorted dictionary
Check if any anagram of a string is palindrome or not
Minimum Insertions to form a Palindrome
Allocate Minimum Number of Pages
Assembly Line Scheduling
Breadth First Search or BFS for a Graph
Find an element in array such that sum of the left array is equal to the sum of the right array
Bridges in a Graph
Bubble Sort in JavaScript
Burn the Binary tree from the Target node
Lowest Common Ancestor in a Binary Search Tree
Types of Hash Functions in C
Implement Dynamic Deque using Templates Class and a Circular Array
Iterative Depth First Traversal of Graph
Linked List Data Structure in C++ With Illustration
Reverse a Linked List in Groups of Given Size
Reverse Alternate K nodes in a Singly Linked List
When should I use a List vs a LinkedList
Why is deleting in a Singly Linked List O(1)
Construct Full Binary Tree using its Preorder Traversal and Preorder Traversal of its Mirror Tree
Find Relative Complement of two Sorted Arrays
Handshaking Lemma and Interesting Tree Properties -DSA
How to Efficiently Implement kStacks in a Single Array
Write C Functions that Modify Head Pointer of a Linked List
Introduction to Ant Colony Optimization
What is Array
The practical Byzantine Fault Tolerance (pBFT)
Applications of Queue Data Structure
Line Graph
Symmetric Binary Tree
AVL Tree Advantages
AVL Tree Time Complexity
Merge Two Binary Trees
Stack Operations in Data Structure
Self-Balancing Binary Search Trees
Sliding Window Maximum (Maximum of all Subarrays of size K)
AVL Trees Operations
Limitations of Stack in Data Structures
Representation of stack in data structure
Advantages of Threaded Binary Tree
Serialize and Deserialize a Binary Tree
Application of Binary Tree
AVL Tree Applications
B Tree Visualization
Properties of AVL Trees
Push and Pop Operation in Stack in Data Structure
Binary Search Tree Implementation
Find Maximum Sum by Replacing the Subarray in Given Range
Find The Number N, Where (N+X) Divisible By Y And (N-Y) Divisible By X
Find Values of P and Q Satisfying the Equation N = P^2.Q
What is the Balance Factor of AVL Tree
AVL Tree Implementation in Golang
Concatenation of two Linked Lists in O(1) time
Find Minimum Area of Rectangle Formed from Given Shuffled Coordinates
Find the Length of Maximum Path in Given Matrix for Each Index
How to Parse an Array of Objects in C++ Using RapidJson
Largest BST in Binary Tree
How to Print String Literal and Qstring With Qdebug in C++
Properties of Binary Tree
Right View of Binary Tree
Strict Binary Tree
Difference between Comb Sort and Shell Sort
Full Binary Tree
Left View of a Binary Tree
Level order Traversal in a Binary Tree
Lowest Common Ancestor of a Binary Tree
Top View of a Binary Tree
Types of Binary Trees
B Tree Insertion
Evaluation of a Postfix notation
B+ Tree Insertion
Bottom View of a Binary Tree
AVL Tree Program in C
B Tree Applications
B Tree Properties
How to Search, Insert, and Delete in an Unsorted Array
Count Non-Leaf Nodes in a Binary Tree
Get the Level of a Given Key in a Binary Tree
Double Ended Priority Queue
B+ Tree Deletion
B+ Tree Insertion
Checking for the Mirror Images in the Binary Trees
Count Non-Leaf Nodes in a Binary Tree
Get a Parent Binary Tree
Get All Descendants of the Binary Tree Element
Get the Level of a Given Key in a Binary Tree
Flatten Binary Tree to Linked List
Formula to Find a Level of the Node in a Binary Tree
Substring with Maximum Number of Vowels of Given Length (k)
Flatten Binary Tree to Sorted Linked List
Floor and Ceiling in Binary Search Tree

## Find The Number N, Where (N+X) Divisible By Y And (N-Y) Divisible By XIn this tutorial, we will learn how to determine the number N, where (N + X) divisible by Y and (N-Y) divisible by X. This is Two numbers, X and Y, are given. Finding the number N(N ≤ 10^18) that meets these two requirements: (N + X) can be divided by Y, and (N - Y) can be divided by X.
The following concept can be used to solve the problem. The number system is a straightforward mathematical idea that we can use. Normalizing the equation allows us to obtain N could be the same as (X*Y - X + Y). Additionally, it meets these two requirements. The solution is therefore (X * Y - X + Y). The application of the aforementioned strategy is seen below:
780
384
780
384
780
384 **Time Complexity**will be**O(1)**.**Auxiliary Space**will be**O(1)**.
So that's the end of the article. I sincerely hope you find this post to be educational and useful. |

For Videos Join Our Youtube Channel: Join Now

- Send your Feedback to [email protected]

JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.

- Website Designing
- Website Development
- Java Development
- PHP Development
- WordPress
- Graphic Designing
- Logo
- Digital Marketing
- On Page and Off Page SEO
- PPC
- Content Development
- Corporate Training
- Classroom and Online Training
- Data Entry

JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].

Duration: 1 week to 2 week