Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 210094

Python 3 is the latest version of the Python programming language and was formally released on December 3rd, 2008. Use this tag along with the main python tag to denote programs that are meant to be run on a Python 3 interpreter only. Do not mix this tag with the python-2.x tag.

4 votes
4 answers
782 views

Tic Tac Toe Game in Python 3

I made this as a personal challenge. It seems to work fine as I can't find any bugs and am happy with how it runs, but I am interested in what I should do to make the code more professional. Note: Th …
Brijesh Kalkani's user avatar
2 votes
2 answers
2k views

Ternary search tree implementation in python 3

I have implemented a Ternary search tree. It works well. But if you think something needs to be improved, say it. This code was tested in Python 3.7.4. class Node(object): def __init__(self, cha …
Brijesh Kalkani's user avatar
3 votes
4 answers
672 views

Matrix with spiral increasing values

This generates a square matrix with spiral inward increasing values. How can I reduce this code? Input Number = 3 Output 1 2 3 8 9 4 7 6 5 import math row=int(input("Input nomber := ")) lis=[[ …
Brijesh Kalkani's user avatar
4 votes
1 answer
679 views

Min Heap Tree Implementation in python 3

I wrote a min-heap using a binary tree. How can I improve the time complexity of insert and delete function to be \$\mathcal{O}(log(n))\$? ''' Min Heap Tree Implementation ''' class Node: def __ …
Brijesh Kalkani's user avatar
4 votes
1 answer
218 views

Singly linked list implementation in python 3

I have implemented a Singly linked list. It works well. But if you think something needs to be improved, say it. This code was tested in Python 3.7.4. class Node(object): def __init__(self, data …
Brijesh Kalkani's user avatar
6 votes
2 answers
297 views

Bubble Sort Implementation in Python 3

I have implemented a Bubble Sort. It works well. But if you think something needs to be improved, say it. This code was tested in Python 3.7.4. def bubble_sort(nums): for i in range(len(nums)-1) …
Brijesh Kalkani's user avatar
1 vote
1 answer
1k views

HashTable implementation in Python 3

I have implemented a hash table. It works well. But if you think something needs to be improved, say it. This code was tested in Python 3.7.4. class Hashtable: def __init__(self,size): se …
Brijesh Kalkani's user avatar
17 votes
7 answers
4k views

Stack data structure in Python 3

I have implemented a stack in Python 3, and it works well. If anything needs to be improved, I would appreciate the criticism. class Stack: def __init__(self): self.stack = [] …
Brijesh Kalkani's user avatar
2 votes
2 answers
140 views

Merge sort implementation in python 3

I have implemented a Merge sort in Python 3, and it works well. If anything needs to be improved, I would appreciate the criticism. def merge_sort(nums): if len(nums) == 1: …
Brijesh Kalkani's user avatar
1 vote
2 answers
625 views

Breadth-first search(BFS) Implementation in Python 3 [closed]

I have implemented a BFS. Does this look like a proper implementation of BFS in Python 3? And if you think something needs to be improved, say it. class Node(object): def __init__(self, name): …
Brijesh Kalkani's user avatar
-2 votes
3 answers
329 views

Heap sort implementation in Python 3

This code relies on Python3.7.4 I'm learning Heapsort in python 3. Please show me the errors in my code. Runs on my computer but tell me if Python rules or not. class Heap: '''constructor''' …
Brijesh Kalkani's user avatar
3 votes
2 answers
354 views

Binary Search Tree implementation in Python 3

Please review my BST Code 1. Class node class Node: 2. Constructor def __init__(self, data): self.left = None self.right = None self.data = data 3. Insert node def insert(self, dat …
Brijesh Kalkani's user avatar
1 vote

Binary Search Tree implementation in Python 3

**Code after the suggestion** 1. Class node class Node: 2. Constructor '''this is the constructor''' def __init__(self, data): self.left = None self.right = None self.data = data 3. …
Brijesh Kalkani's user avatar
0 votes

Heap sort implementation in Python 3

Code after the suggestion class Heap: def __init__(self,List): self.List = List self.a = [] def heapify(self,i): #To swap variable # (i-1) // 2 = is get the ro …
Brijesh Kalkani's user avatar