API References¶
All about concise API references manual for pure-datastructures
, with the detail about classes, function, return types, arguments and throwing exception.
procedure_search_obj(**kwargs)
¶
- Search any value / elements through List. return
False
if there's a value otherwise returnTrue
. - Throwing
missing {} required positional arguments
if not set the value.
procedure_push(**kwargs)
¶
- Set a value through
List
andQueue
, like a basic insertion or appending a value. ForOrderedList()
, new value didn't stored intemporary
variables, likewise, forUnorderedList()
new value would be stored intemporary
variables (sinceUnorderedList()
is using 0(n) for append a value).
procedure_pop()
¶
- Same function like
procedure_push()
, the different this will raise anIndexError
if stack is empty or has no value. Only work in Stack references.
procedure_expand_size()
¶
- Expanding or double length of array (formula: array +
None
* size of array) . Work in all data structures references. Automatically returnNone
if an array doesn't have a value.
procedure_peek()
¶
- Check the top-most of any elements in array.
procedure_enqueue(**kwargs)
¶
- Push new object or value to queue.
procedure_dequeue()
¶
- Remove first object or value from queue.
- Raise an
IndexError
if you have not set a value before popped out. As a for concern,dequeue
process in basicQueue
andCircularQueue
is different.
is_empty()
¶
- Check whether an array does have a value or not. In
Stack
andQueue
case, will returnFalse
if stack/queue is empty and returnTrue
if not empty. - For
List
, will not return any value exceptNone
.
is_full()
¶
- Check whether an array does have a value or not. Only available in
Stack
andQueue
, throwing exceptions work out same as likeis_empty()
.
is_balanced()
¶
- Check if an array does have a same balanced through inputted value, available in
Stack
andQueue
only. Inputted value only works with parenthesis like.
DsIndexError()
¶
-
Throwing exception, one of the basic and common error in this package. This will raise if inputted value is attempt to access the outside that index of list. Error message :
Stack / List / Queue is empty, set a value first.
DsPeekIndexError()
¶
-
Throwing exception, the difference with
DsIndexError()
, it will raise ifprocedure_peek()
process didn't find any value from that index of list. Error message :Stack / List / Queue is empty, you either must be popped or not set a value.
DsValueError()
¶
-
Throwing exception, that indicates the data-type or value is not correct. Error message :
Value error, either your argument or inputted value is not correct.