Giter VIP home page Giter VIP logo

python-data-structures's Introduction

Python-Queues

Comments and doc strings were written using ChatGPT.

Contains classes for these data structures:

  • Queues
  • Linked Lists
  • Stacks

Queue Methods

  • display_queue(self): Displays the current status of the circular queue.
  • is_full(self) -> bool: Returns True if the queue is full; otherwise, returns False.
  • is_empty(self) -> bool: Returns True if the queue is empty; otherwise, returns False.
  • size(self) -> bool: Returns the current size of the queue
  • peek(self): Returns the item at the front of the queue or None if empty
  • enqueue(self, item_to_add) -> bool: Adds an item to the rear of the queue. Returns True on success, False if the queue is full.
  • dequeue(self): Removes and returns an item from the circular queue. Returns None if the queue is empty.
  • clear(self): Removes all items from the queue and reset pointer values.

Linked List Methods

  • get_list(self): Returns a list after traversing through the node
  • add_node_in_order(self, data): Add a node to the linked list adhering to ascending order
  • add_node_at_front(self, data): Add a node with data to the front of the linked list
  • delete(self, data): Delete a node containing data given in parameter

Stack Methods

The stack data structure is implemented using a linked list.

  • is_empty(self): Returns True if the stack is empty; otherwise, returns False
  • pop(self): Remove and return the top element of the stack
  • peek(self): Returns the top element of the stack without removing it

python-data-structures's People

Contributors

viren070 avatar

Watchers

 avatar

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.