Trying to share some code ideas

logo

Tag: Code

Merging Tables

Simulates a sequence of merge operations with tables in a database.

See code below

Fractional Knapsack

Standard problem of trying to maximize the values of item with a constraint.  How many items can you put in a knapsack given the value and the weight of the items.

Uses python3
goal: maximize the value of items selected from the get_optimal_value
while the items selected combined weight is less than the inputted capacity

Binary Search

Binary Search Problem

Function below handles a simple search for a needle in a haystack using the binary search algorithm.

The function is called recursively to check if a value is inside the array

See python code below.

Page 3 of 3

Powered by WordPress & Theme by Anders Norén