All Questions
32 questions
2
votes
1
answer
662
views
Find all permutations of string using recursion
Background: I am somewhat new to programming and only two weeks into learning Python. Currently trying to improve my understanding of recursion, which has been a tough concept for me to implement.
...
6
votes
2
answers
314
views
A selection sort implemented in Python
I'm not proficient at Python. My question is twofold: whether this selection sort algorithm implementation for number lists could be considered clean code (in the sense of being modular and ...
1
vote
2
answers
678
views
Duplicate Binary Search Improvements
I'm working on an implementation of binary search (in Python) that can operate on a sorted array that may have duplicate elements.
I've written a submission that has managed to hold up against my test ...
5
votes
1
answer
9k
views
Simple IP address subnet calculator
In this task I had to create simple IP address / subnet calculator in Python. I'm just wondering how you see this problem.
There is my code:
...
10
votes
6
answers
4k
views
Intersection of sorted lists
I don't like this function. Looks too imperative.
It takes two sorted lists and returns a sorted intersection of the two lists. There is an implicit assumption that there are no duplicate elements in ...
3
votes
0
answers
246
views
Strongly Connected component algorithm implementation(Python)
My goal is to implement Strongly Connected Components algorithm using python.
I have splitted up my code on 3 parts:
Data Load:
...
6
votes
1
answer
1k
views
Calculate the day when Date is given as input using the Doomsday algorithm
Was too bored in holidays...here's a code which finds the day of the week using the algorithm in this video. Please give a logical date in the correct format cause I didn't account for improper inputs ...
1
vote
2
answers
128
views
3
votes
1
answer
186
views
Python implementation of Conway's chained arrow notation
A year ago, I implemented an evaluation algorithm for Conway's chained arrow notation in Python. I'd like to get a review on my code, especially about readability and if it is pythonic. I'd also like ...
2
votes
1
answer
180
views
Pythonic quick sort
I'm new to the world of python, and wrote this quick sort implementation which was taught to us in an algorithms class. I would like to learn to write code less like C++ and more pythonic. Could you ...
17
votes
1
answer
18k
views
Min/Max Heap implementation in Python
I'm refreshing some of my datastructures. I saw this as the perfect opportunity to get some feedback on my code.
I'm interested in:
Algorithm wise:
Is my implementation correct? (The tests say so)
...
2
votes
2
answers
2k
views
Heap Sort Implementation in Python
Objective: Create a heap sort that returns a unsorted list to sorted from greatest to least.
Does this implementation look correct? Do you have any tips for optimizing this?
...
27
votes
7
answers
8k
views
1
vote
1
answer
90
views
Algorithmic complexity of this algorithm to find all ordered permutations of length X
I have written a recursive function to generate the list of all ordered permutations of length X for a list of chars.
For instance: ['a', 'b', 'c', 'd'] with X=2 will give [['a', 'a'], ['a', 'b'], ['...
2
votes
1
answer
408
views
Optimisation suggestions for Min Heap
Can someone please optimisations for my implementation of min heap.Its performance is poor compared to the heapq module in python. My use case for the MinHeap class is 'N' insertions and extractions ...