All Questions
Tagged with object-oriented algorithm
92 questions
3
votes
1
answer
102
views
Merge discrete integer intervals
What it does
The code starts with a set of integer intervals, and can add new intervals (possibly by updating existing intervals). Essentially, it is a bit array whose index starts at ...
4
votes
1
answer
137
views
Advanced Python Calculator using OOP
I've been into computer science fundamentals (proper data structures/algorithms/etc) including Object Oriented Programming. Therefore, I decided to reformat my old traditional Python Calculator into ...
1
vote
2
answers
116
views
Object-Oriented Blackjack V2
[Edited] formatting and Flake8 linter corrections
Four days ago I posted my first object oriented programming project.
Everything I have learned to date is self-taught and posting project to receive ...
6
votes
4
answers
288
views
Object-Oriented Blackjack
[Edited: added V2 link]
BlackJack V2 - Github
This is my first post, and I was actually going to post this on Stackoverflow when I was rather suggested posting the code here, as it may be better ...
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 &...
0
votes
2
answers
866
views
Generates all pairs (combinations of 2) up to a limit (exclusive)
Any improvements on this combination generator.
Seen a lot of combination generators online, but none like this.
Found pseudocode at:
https://www.baeldung.com/cs/generate-k-combinations
Fastest I ...
2
votes
0
answers
43
views
JavaScript Linter in Java
I wrote a simple Linter that checks for matching opening and closing braces for one line of JavaScript. It utilizes a stack to store opening braces found in the line, then compares the first closing ...
5
votes
4
answers
3k
views
C++ basic bank money class
I am trying to create a basic money class that fits into a small console banking application I am making.
Money.h
...
2
votes
1
answer
647
views
red black tree implementation in cpp
I am learning algorithms and trying to implement them in c++, I have chosen to try to implement a red-black tree due to its self-balancing properties and its ability to stop the worst case of O(n) ...
0
votes
2
answers
499
views
c++ Most clean way to implement duplicate Binary Search Tree for complex type
I have tried to make my own implementation for a BST task I was given for a complex type (Transaction), that should be able to store duplicate values as well.
However, I am not sure if I have gone ...
7
votes
2
answers
342
views
ASCII-based OOP blackjack game in Python
I'm new to programming and have been teaching myself to code for about 6 months. Since I have no one to ask about any of coding-related questions, I may have developed bad habits in the meantime, but ...
3
votes
2
answers
165
views
Finding Number of Objects in Image
I wrote a program that, given a 2D array representing pixels in a birds eye view image, it returns the number of Objects in the image.
Pixels that are connected in the up, down, left, and right ...
1
vote
1
answer
210
views
Rock paper scissors coding assignment
I had a coding assignment to write a Rock Paper Scissors game. The main task is not to show a solution but rather to test the coding style. The rules are such:
Problem:
rock is "O", paper is ...
1
vote
2
answers
132
views
checking is ellipse is filled or not
following code below works fine but feels kind of a mess. Any one has a better way to do this?
I am creating a basic "Enter Pin" to unclick screen on an app. So if the user enters the 1st ...
2
votes
2
answers
197
views
Parking places design
I got a question:
Design a parking system. There are 3 types of parking spaces: big, medium and small.
Implement ParkingSystem class(int big, int medium, int small)....