This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PriorityQueue: | |
""" | |
This priority queue uses a given number as priority order. | |
The smallest number has the higher priority | |
""" | |
def __init__(self): | |
self.queue = [] | |
def enqueue(self, value: str, priority: int) -> None: | |
"""Add the value the queue based on its priority""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct Node { | |
int value; | |
struct Node *next; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stack: | |
def __init__(self): | |
self.items = [] | |
def push(self, value): | |
self.items.append(value) | |
def pop(self): | |
return self.items.pop() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Stack struct { | |
size int | |
position int | |
items []int | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct Stack { | |
int size; | |
int top; | |
int *items; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"always_show_minimap_viewport": true, | |
"binary_file_patterns": | |
[ | |
"*.dds", | |
"*.eot", | |
"*.gif", | |
"*.ico", | |
"*.jar", | |
"*.jpeg", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, value, next_node=None): | |
self.value = value | |
self.next_node = next_node | |
def __str__(self): | |
return f"Node(value={self.value})" | |
class LinkedList: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, value, next_node=None): | |
self.value = value | |
self.next_node = next_node | |
def __str__(self): | |
return f"Node(value={self.value})" | |
class LinkedList: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone [email protected]:LucasMagnum/trackmywork.git | |
export TRACKMYWORK_DEFAULT_CATEGORY="work" | |
alias trackmywork="python /home/projects/trackmywork/main.py" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $ python app/manage.py shell | |
from products.queries import ( | |
categories_list_active_subcategories, | |
categories_list_active_subcategories_using_prefetch_attr, | |
categories_list_active_subcategories_using_prefetch_queryset | |
) | |
results = [ | |
categories_list_active_subcategories(), |