This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am imdanielsp on github. | |
* I am imdanielsp (https://keybase.io/imdanielsp) on keybase. | |
* I have a public key ASBEsUIPJNynhCCdYPYr_24sgfdW4UsP8P8Hs9S4R-28Sgo | |
To claim this, I am signing this object: |
This file contains 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 <stdlib.h> | |
#include "queue.h" | |
#include "../LinkedList/linked_list.h" | |
struct Queue { | |
pLinkedList buffer; | |
}; | |
pQueue makeQueue() { | |
pQueue newQueue = malloc(sizeof(Queue)); |
This file contains 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
/** | |
* \brief T is the template type used in the queue. For other types | |
* support, change 'int' to the type desired. | |
* */ | |
typedef int T; | |
/** | |
* \brief A forward declaration of the queue. This gives the client | |
* access to the Queue object itself without knowing the expecificts of the | |
* implementation making the object opaque. |
This file contains 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
def converter(number, base): | |
def convert_to_base_10(val): | |
target_base = 10 # Target number base | |
output_sum = 0 # Initial value for output sum | |
expo = 0 # Initial exponent | |
digits = [int(x) for x in str(val)] # Convert the base 2 number to an array of integer | |
digits.reverse() # Reverse the array. | |
for d in digits: # For each bit... | |
if d != 0: # If it's not 0, we will get the value relative to the position |