Comparing version 0.1.48 to 0.1.49
@@ -14,4 +14,4 @@ import { PriorityQueue } from './priorityQueue'; | ||
import { ValueType } from './types'; | ||
import { LinkedList, addTwoNumbers } from './linkedList'; | ||
import { LinkedList, addTwoNumbers, removeNthFromEnd, ListNode, traverseLinkedList } from './linkedList'; | ||
import { longestPalindrome, maxSubArray } from './dynamicProgramming'; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, longestPalindrome, hash, groupAnagrams, multiply, maxSubArray, twoSum, maxArea, moveZeroes, findDuplicate, isValidParentheses, isValidParenthesisV2, minRemoveToMakeValid, longestValidParentheses, StackQueue, ValueType, LinkedList, addTwoNumbers, }; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, longestPalindrome, hash, groupAnagrams, multiply, maxSubArray, twoSum, maxArea, moveZeroes, findDuplicate, isValidParentheses, isValidParenthesisV2, minRemoveToMakeValid, longestValidParentheses, StackQueue, ValueType, LinkedList, addTwoNumbers, removeNthFromEnd, ListNode, traverseLinkedList, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addTwoNumbers = exports.LinkedList = exports.StackQueue = exports.longestValidParentheses = exports.minRemoveToMakeValid = exports.isValidParenthesisV2 = exports.isValidParentheses = exports.findDuplicate = exports.moveZeroes = exports.maxArea = exports.twoSum = exports.maxSubArray = exports.multiply = exports.groupAnagrams = exports.hash = exports.longestPalindrome = exports.isSubPalindrome = exports.strip = exports.isPalindrome = exports.backspaceCompare = exports.lengthOfLongestSubstringTwoDistinct = exports.lengthOfLongestSubstring = exports.Matrix = exports.Dijkstra = exports.Graph = exports.searchRange = exports.binarySearchRange = exports.binarySearch = exports.quickSelectPivot = exports.quickSelect = exports.pivot = exports.quickSort = exports.BST = exports.BinaryNode = exports.BinaryTree = exports.PriorityQueue = void 0; | ||
exports.traverseLinkedList = exports.ListNode = exports.removeNthFromEnd = exports.addTwoNumbers = exports.LinkedList = exports.StackQueue = exports.longestValidParentheses = exports.minRemoveToMakeValid = exports.isValidParenthesisV2 = exports.isValidParentheses = exports.findDuplicate = exports.moveZeroes = exports.maxArea = exports.twoSum = exports.maxSubArray = exports.multiply = exports.groupAnagrams = exports.hash = exports.longestPalindrome = exports.isSubPalindrome = exports.strip = exports.isPalindrome = exports.backspaceCompare = exports.lengthOfLongestSubstringTwoDistinct = exports.lengthOfLongestSubstring = exports.Matrix = exports.Dijkstra = exports.Graph = exports.searchRange = exports.binarySearchRange = exports.binarySearch = exports.quickSelectPivot = exports.quickSelect = exports.pivot = exports.quickSort = exports.BST = exports.BinaryNode = exports.BinaryTree = exports.PriorityQueue = void 0; | ||
var priorityQueue_1 = require("./priorityQueue"); | ||
@@ -51,4 +51,7 @@ Object.defineProperty(exports, "PriorityQueue", { enumerable: true, get: function () { return priorityQueue_1.PriorityQueue; } }); | ||
Object.defineProperty(exports, "addTwoNumbers", { enumerable: true, get: function () { return linkedList_1.addTwoNumbers; } }); | ||
Object.defineProperty(exports, "removeNthFromEnd", { enumerable: true, get: function () { return linkedList_1.removeNthFromEnd; } }); | ||
Object.defineProperty(exports, "ListNode", { enumerable: true, get: function () { return linkedList_1.ListNode; } }); | ||
Object.defineProperty(exports, "traverseLinkedList", { enumerable: true, get: function () { return linkedList_1.traverseLinkedList; } }); | ||
var dynamicProgramming_1 = require("./dynamicProgramming"); | ||
Object.defineProperty(exports, "longestPalindrome", { enumerable: true, get: function () { return dynamicProgramming_1.longestPalindrome; } }); | ||
Object.defineProperty(exports, "maxSubArray", { enumerable: true, get: function () { return dynamicProgramming_1.maxSubArray; } }); |
@@ -14,2 +14,4 @@ declare class ListNode { | ||
declare function addTwoNumbers(l1: ListNode | null, l2: ListNode | null): ListNode; | ||
export { LinkedList, addTwoNumbers, ListNode }; | ||
declare function removeNthFromEnd(head: ListNode, n: number): ListNode; | ||
declare function traverseLinkedList(head: ListNode): number[]; | ||
export { LinkedList, addTwoNumbers, ListNode, removeNthFromEnd, traverseLinkedList }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ListNode = exports.addTwoNumbers = exports.LinkedList = void 0; | ||
exports.traverseLinkedList = exports.removeNthFromEnd = exports.ListNode = exports.addTwoNumbers = exports.LinkedList = void 0; | ||
var ListNode = /** @class */ (function () { | ||
@@ -99,1 +99,32 @@ function ListNode(val) { | ||
exports.addTwoNumbers = addTwoNumbers; | ||
function removeNthFromEnd(head, n) { | ||
var current = head; | ||
var len = 0; | ||
while (current !== null) { | ||
len += 1; | ||
current = current.next; | ||
} | ||
var pos = len - n; | ||
var count = 0; | ||
current = head; | ||
while (count < pos - 1) { | ||
current = current === null || current === void 0 ? void 0 : current.next; | ||
count += 1; | ||
} | ||
var next = current === null || current === void 0 ? void 0 : current.next; | ||
if (current !== null) { | ||
current.next = next === null || next === void 0 ? void 0 : next.next; | ||
} | ||
return head; | ||
} | ||
exports.removeNthFromEnd = removeNthFromEnd; | ||
function traverseLinkedList(head) { | ||
var values = []; | ||
var current = head; | ||
while (current !== null) { | ||
values.push(current.val); | ||
current = current.next; | ||
} | ||
return values; | ||
} | ||
exports.traverseLinkedList = traverseLinkedList; |
{ | ||
"name": "flex-algo", | ||
"version": "0.1.48", | ||
"version": "0.1.49", | ||
"description": "\"SDK for commonly used data structure and algorithms\"", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67014
1847