排序
Data Structures and Algorithms in Python
Data Structures and Algorithms in Python,1. Arrays e Linked Lists Arrays An array is a collection of elements stored in contiguous memory locations. Characteristics: Fast access to...
Alien Dictionary
Alien Dictionary, Problem statement You have been given a sorted (lexical order) dictionary of an alien language. Write a function that returns the order of characters as a string ...
Bipartite-Based 2-Approximation for Dominating Sets in General Graphs
Bipartite-Based 2-Approximation for Dominating Sets in General Graphs,Frank Vega Information Physics Institute, 840 W 67th St, Hialeah, FL 33012, USA vega.frank@gmail.com Problem S...
Leetcode 2385. Amount of Time for Binary Tree to Be Infected
Leetcode 2385. Amount of Time for Binary Tree to Be Infected, Problems You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection s...
Local Search vs Stochastic Hill Climbing: Python Implementation, Testing, and Comparative Analysis
Local Search vs Stochastic Hill Climbing: Python Implementation, Testing, and Comparative Analysis,Optimization of Benchmark Functions Using Local Search and Stochastic Hill Climbi...
GeeksforGeeks : M Coloring Problem
GeeksforGeeks : M Coloring Problem, Problem https://www.geeksforgeeks.org/problems/m-coloring-problem-1587115620/1 You are given an undirected graph consisting of v vertices and a ...
Leetcode 19 : Remove nth Node from end of List
Leetcode 19 : Remove nth Node from end of List, Problem Statement https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/ Given the head of a linked list, remov...
Prime Function
Prime Function,def get_primes(n): primes = [] candidate = 2 while len(primes) < n: for p in primes: if candidate % p == 0: break else: primes.append(candidate) candidate += 1 re...
Recursion Power Sum
Recursion Power Sum,def powerSum(X, N, num=1): power = num ** N if power > X: return 0 # too big, can't continue elif power == X: return 1 # exact match found else: # either inc...
A 2-Approximation Algorithm for Dominating Sets
A 2-Approximation Algorithm for Dominating Sets,Frank Vega Information Physics Institute, 840 W 67th St, Hialeah, FL 33012, USA vega.frank@gmail.com Introduction to the Minimum Dom...
LeetCode 3169. Count Days Without Meetings
LeetCode 3169. Count Days Without Meetings, Problem Statement You are given a positive integer days representing the total number of days an employee is available for work (startin...
Leetcode 1976 : Number of Ways to Arrive at Destination
Leetcode 1976 : Number of Ways to Arrive at Destination, Problem Statement You are in a city with n intersections numbered from 0 to n - 1 with bi-directional roads between some in...