Skip to content

Jaidev810/Data-Structures-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of Data Structure

Just write one command and get access to different types of data structures. Code for Following data structures has been written:

  1. Singly Linked List
  2. Doubly Linked List
  3. Circular Linked List
  4. Binary Tree

Command to install Package

Run this command: pip install easy_ds

For Singly Linked List

Create an object for class LinkedList and use following functions:

  1. Create Singly Linked List : takeInput() -- returns head node
  2. Printing Linked List: PrintLL(head) -- returns None
  3. Getting Length: getLength(head) -- returns int
  4. Getting Middle Element: getMiddle(head) -- returns int
  5. Reversing Linked List: reverseLL(head) -- returns reversed head node

For Doubly Linked List

Create an object for class DoublyLinkedList and use following functions:

  1. Create Doubly Linked List: takeinput() -- returns head node
  2. Printing Linked List: PrintLL(head) -- returns None
  3. Getting Length: getLength(head) -- returns int
  4. Getting Middle Element: getMiddle(head) -- return int

For Binary Tree

Create an Object for class BinaryTree and use following functions:

  1. Create a Binary Tree: takeinput() -- return root node
  2. Printing Tree structure: printLevelWise(root) -- returns None
  3. Printing Level Wise: levelorder(root) -- returns None
  4. Printing Preorder: preorder(root) -- returns None
  5. Printing Inorder: inorder(root) -- returns None
  6. Printing Postorder: postorder(root) -- returns None

Enter -1 if no Child in takeinput() function.