Simple implementation of data structures for python
Project description
fds
Simple implementaion of data structures (DS) for python
Content
- linked list
- stack
- queue
Classes
- List // linked list
- Stack // stack
- Queue // queue
API
List
- insert(self, data, pos=0) // TODO: add node in the entered position (pos=0 => add in the begining)
- append(self, data) // TODO: add node in the end
- delete(self, data) // TODO: delete all nodes hav the entered data
- remove(self, pos=0) // TODO: return and remove node in the entered position (pos=0 => remove first node, pos=-1 => remove last node)
- first(self) // TODO: return the data in the first node
- last(self) // TODO: return the data in the last node
Stack
- push(self, data) // TODO: add a node to the top
- pop(self) // TODO: return and remove the node in the top
- top(self) // TODO: return the data in the first node
Queue
- enqueue(self, data) // TODO: add a node to the end
- dequeue(self) // TODO: return and remove the first element
- front(self) // TODO: return the data in the first node
- back(self) // TODO: return the data in the last node
API for all structures
- repr(self) // USE: print([DS_name]) // TODO: display the DS
- len(self) // USE: len([DS_name]) // TODO: return the lenth of the DS
- empty(self) // TODO: return True if the DS is empty
- clear(self) // TODO: clear the DS
- find(self, data) // TODO: return the number of how many the entered data found in the DS
- reverse(self) // TODO: return the reverse of the DS
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py-fds-1.1.tar.gz
(3.0 kB
view hashes)
Built Distribution
py_fds-1.1-py3-none-any.whl
(4.7 kB
view hashes)