exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Queue Abstract Data Type Tool

Queue Abstract Data Type Tool
Posted Jul 1, 2022
Authored by Raed Ahsan

This tool can be embedded into AI systems for storing information and deleting it very efficiently by using queues disguising themselves as arrays and adding data and removing the data using pointers and flags.

tags | tool
systems | unix
SHA-256 | 8f54b905160a1220ecf3c33ac6bae06583c2c8c8cf9712f69ed5343016f6bbe6

Queue Abstract Data Type Tool

Change Mirror Download
# Author : Raed Ahsan
# Date : 22.06.2022
# Time : 9:37 PM

#Queue ADT ( CIRCULAR )

# Initialization
frontpointer = -1
rearpointer = -1
Qsize = 0
Qfull = 10
ub = 9

queue = [None for x in range(9)]

def initializeQ():
frontpointer = -1
rearpointer = -1
Qsize = 0
Qfull = 10
ub = 9

for i in range(9):
queue[i] = None

# Enqueue ( INSERTION ) - REARPOINTER :

def enqueue(data):
global Qsize, Qfull, rearpointer, ub
if Qsize == Qfull:

print("[!]--Overflow Error")
else:
if rearpointer == ub:
rearpointer = 0
else:
rearpointer = rearpointer + 1

queue[rearpointer] = data
Qsize = Qsize + 1


# Dequeue ( DELETION ) - FRONTPOINTER :

def dequeue():
global frontpointer, ub, Qsize

if Qsize == 0:
print("[!] Underflow error, no sufficient values.")
else:
if frontpointer == ub:
frontpointer = 0
else:
frontpointer = frontpointer + 1

print("Data Dequeued: ", queue[frontpointer])
Qsize = Qsize - 1

# Printing live values for the queue ADT circular function..

def live_track():
global rearpointer, frontpointer, Qsize
print("RearPointer Location: ", rearpointer)
print("FrontPointer Location: ", frontpointer)
print("The Qsize filled: ", Qsize + 1)
print(queue)
queue[frontpointer] = None

# Final execution test:
#enqueue:

# enqueue('a')
# live_track()
# enqueue('b')
# live_track()
# enqueue('c')
# live_track()
# enqueue('d')
# live_track()

#dequeue:

# dequeue()
# live_track()
# dequeue()
# live_track()
# dequeue()
# live_track()
# dequeue()
# live_track()
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    48 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    60 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    44 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close