Code Monkey home page Code Monkey logo

data-structures-using-python's Introduction

Data-Structures-using-Python

This is my repository for Data Structures using Python. This repository mainly aims at implementation of various Data Structures using Python.

Omkar Pathak,
Pune, Maharashtra, India.

Arrays

Linked Lists

Stack

Queue

Tree

Graph

Heap

Dynamic Programming

Donation

If you have found my softwares to be of any use to you, do consider helping me pay my internet bills. This would encourage me to create many such softwares :)

PayPal Donate via PayPal!
โ‚น (INR) Donate via Instamojo

data-structures-using-python's People

Contributors

6ug avatar abhishakvarshney avatar adi0311 avatar ankit-555 avatar dhirendrachoudhary avatar emredogan7 avatar imalk96 avatar jagritij avatar juzar10 avatar kehsihba19 avatar kshitiz-jain avatar omkarpathak avatar parameswaran-natarajan avatar raajeshmani avatar s-sanyal avatar sakshamj74 avatar sakshiiagrawal avatar samithadilan avatar sandromirr avatar virajgite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

data-structures-using-python's Issues

Delete function in LinkedList.py not working

@OmkarPathak, In the delete method in linkedlist.py the last element will be deleted if the given key is not present and if only the head node is present then there will a reference error for prev node.

So I have made some changes and it works

# deleting an item based on data(or key)
def delete(self, data):
    temp = self.head
    # if data/key is found in head node itself
    if(temp.data == data):
            self.head = temp.next
            temp = None
            return
        else:
            #  else search all the nodes
            while(temp.next):
                if(temp.data == data):
                    break
                prev = temp          #save current node as previous so that we can go on to next node
                temp = temp.next
            
            # node not found
            if temp == None:
                return
            
            prev.next = temp.next
            return

Bug in Queue Program example. It doesn't respect First In First Out property

Hi Omkar,

Append and Pop will add and remove the elements at the end of list.
Queue follows first come first serve property(FIFO). consider the following example

a = []
a.enqueue(1) # adding the element to empty queue
a
[1]
a.enqueue(2) # adding the second element
[1, 2]
a.dequeue() # removing the first element
a
[2]

To remove the first element use the pop(0) instead of pop()
Nice Collection of tutorials. Great Work!!

Thanks,
Sundeep Gullapudi.

CircularQueue.py

enqueue(): rear = (rear + 1)%size
This logic is not implemented, the present circular queue behaves more or less like queue.

Typo

#Array.ipynb file
'The array elements can be accessed in constant time by using the index of the parliculnr element as the subscript.'

Can I change arrayType to user defined class?

Not int or float. I want to use class which is I defined. Plus, I don't use any list or dictionary type inside my class.

class Array(object):
    ''' sizeOfArray: denotes the total size of the array to be initialized
       arrayType: denotes the data type of the array(as all the elements of the array have same data type)
       arrayItems: values at each position of array
    '''
    def __init__(self, sizeOfArray, arrayType = int):
...

Thank you.

Balanced Binary Search Tree constructor

It would be nice to add a method to the BST class so that given an unsorted array of integers a balanced BST is constructed. I'm not sure whether it is already in the repo but I have not been able to find it. I'd be happy to take care of it if you find it interesting :)

Unreadable Notebook

Hi Omkar!!
Firstly, thanks for this awesome repo. I was facing trouble with opening the Queue.ipynb file, please check the attached image.
capture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.