Skip to main content

All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
126 views

Segmentation of list to minimize the largest sum

I have written the following code for diving a list 'seq' into 'k' segments such that the maximum sum of each segment is minimized. I have used dynamic programming to solve this problem. But my class &...
Jahid Chowdhury Choton's user avatar
3 votes
1 answer
362 views

Implement hash table using linear congruential probing in python

I have just read the Chapter 5 of Data Structures and Algorithms with Python. The authors implemented hash sets using linear probing. However, linear probing may result in lots of clustering. So I ...
user141240's user avatar
2 votes
0 answers
222 views

Implement priority queue as min-heap in python

The standard library heapq in python doesn't support updating keys as a public method, which makes it hard to be used as a priority queue. Although the official ...
user141240's user avatar
9 votes
1 answer
956 views

Geektrust: Solve War problem in a OO way in Python

I solved this programming challenge whose objective is to come up with an OO solution to the problem. The problem statement is quite verbose and the tl;dr version would be: Given an enemy army(...
thebenman's user avatar
  • 1,178
7 votes
1 answer
339 views

Extending the extended Stable Marriage Problem using a Python class

As soon as I saw this open source paper, I thought that the best way to replicate their code would be using a python class. After having replicated and extended the ...
B Furtado's user avatar
  • 133
13 votes
1 answer
700 views

Bratwurst.py - A helper program for a cashier

I am a student in Germany, more specifically in Bavaria, and here we use to have a so-called "Kirwa", an event for celebrating the establishment of the local church - technically that's the ...
Patrick Hollweck's user avatar
5 votes
2 answers
1k views

MySQL parser written in Python3

As the title suggests, I'm building a MySQL parser in python. The intention of this is to better support application development by managing migrations in a more declarative way. You can read about ...
Conor Mancone's user avatar
4 votes
1 answer
7k views

Banking system program

I'm creating a Banking system program using Python, and the requirements of this program are very basic: Register and maintain Customer Details Update Account balance through Deposits and Withdrawals ...
Ihan Dilnath's user avatar
15 votes
2 answers
4k views

Condorcet voting method in OOP Python

For learning purposes, I made this little class which determines the Condorcet winner of a rank voting election (basically, a Condorcet winner is a candidate that would beat every other candidate in a ...
Jivan's user avatar
  • 407