mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
@ -2,7 +2,7 @@
|
|||||||
Problem: Given two numbers, n and k, make all unique combinations of k numbers from 1 to n and in sorted order
|
Problem: Given two numbers, n and k, make all unique combinations of k numbers from 1 to n and in sorted order
|
||||||
|
|
||||||
What is combinations?
|
What is combinations?
|
||||||
- Combinations is selecting items from a collections without considering order of selection
|
- Combinations is selecting items from a collections without considering the order of selection
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
- We have an apple, a banana, and a jackfruit
|
- We have an apple, a banana, and a jackfruit
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Notes:
|
* Notes:
|
||||||
* - works by using divide and conquer
|
* - works by using divide and conquer
|
||||||
* - the function gets the array A with n Real numbers and returns the local max point index (if more than one exists return the first one)
|
* - the function gets the array A with n Real numbers and returns the index of local max point (if more than one exists return the first one)
|
||||||
*
|
*
|
||||||
* @complexity: O(log(n)) (on average )
|
* @complexity: O(log(n)) (on average )
|
||||||
* @complexity: O(log(n)) (worst case)
|
* @complexity: O(log(n)) (worst case)
|
||||||
|
@ -42,7 +42,7 @@ class Graph {
|
|||||||
|
|
||||||
// iterate over the vertices
|
// iterate over the vertices
|
||||||
for (const i of getKeys) {
|
for (const i of getKeys) {
|
||||||
// great the corresponding adjacency list
|
// get the corresponding adjacency list
|
||||||
// for the vertex
|
// for the vertex
|
||||||
const getValues = this.AdjList.get(i)
|
const getValues = this.AdjList.get(i)
|
||||||
let conc = ''
|
let conc = ''
|
||||||
|
Reference in New Issue
Block a user