Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Work with linkedlists datastructure in Python
pip install py-linkedlist
# Importing linkedlist to your code
from linkedlist import linkedlist
Initialising a linkedlist
l_list = linkedlist()
#Adding First element to the linkedlist
l_list.add(10)
# Appending a list to the linkedlist
l_list.add([1, 2])
# Appending a tuple to the linkedlist
l_list.add((3, 4, 3))
# Adding new element at head position in linkedlist
l_list.addAtHead(20)
Any data type including String, Dictonary, Sets etc. can be added to linkedlist
# Priting the linkedlist to console
l_list.show()
output: 20->10->1->2->3->4->3
# Returns length of linkedlist
print(l_list.length())
output: 7
# Remove first occurance of an element (3)
# l_list: 20->10->1->2->3->4->3
l_list.removeElement(3)
l_list.show()
output: 20->10->1->2->4->3
# Remove using element position
# l_list: 20->10->1->2->4->3
l_list.removeAtLoc(2)
l_list.show()
output: 20->1->2->4->3
# Remove Head/First element in linkedlist
# l_list: 20->1->2->4->3
l_list.removeHead()
l_list.show()
output: 1->2->4->3
# Remove Tail/Last element in linkedlist
# l_list: 1->2->4->3
l_list.removeTail()
l_list.show()
output: 1->2->4
# Remove All elements in linkedlist
# l_list: 1->2->4->3
l_list.removeAll()
l_list.show()
output: None
# Checking the linkedlist is Empty/Not
print(l_list.isEmpty())
output: True
# Get Linkedlist with location. Linkedlist are zero-indexed based
l_list.add((13, 41, 34))
print(l_list.eleAt(2))
output: 34
pip uninstall py-linkedlist
FAQs
LinkedList Package
We found that py-linkedlist demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.