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
''' | |
by Adrian Statescu <[email protected]> | |
MIT Style License | |
''' | |
def merge(arrA,arrB): | |
arrC = [] | |
i = 0 | |
j = 0 | |
n = len(arrA)-1 | |
m = len(arrB)-1 |
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
<?php | |
/** | |
* by Adrian Statescu <[email protected]> | |
* Twitter: @thinkphp | |
* G+ : http://gplus.to/thinkphp | |
* MIT Style License | |
*/ | |
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
''' | |
by Adrian Statescu <[email protected]> | |
Twitter: @thinkphp | |
G+ : http://gplus.to/thinkphp | |
MIT Style License | |
''' | |
''' | |
Binary Search Tree | |
------------------ |
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
/** | |
* by Adrian Statescu <[email protected]> | |
* Twitter: @thinkphp | |
* G+ : http://gplus.to/thinkphp | |
* MIT Style License | |
*/ | |
var Node = new Class({ | |
initialize: function(info) { |
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
/** | |
* by Adrian Statescu <[email protected]> | |
* Twitter: @thinkphp | |
* G+ : http://gplus.to/thinkphp | |
* MIT Style License | |
*/ | |
function Node(info){ | |
this.info = info | |
this.left = null; |
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
#defines a linked list iterator for the list | |
class NodeIterator: | |
def __init__(self,listHead): | |
self._currNode = listHead | |
def __iter__(self): | |
return self | |
def next(self): | |
if self._currNode is None: |
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
class Node: | |
def __init__(self, info, left=None,right=None): | |
self.info = info | |
self.left = left | |
self.right = right | |
def __call__(self, left=None, right=None): | |
self.left = left | |
self.right = right | |
return self.info |
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
''' | |
Twitter: @thinkphp | |
Website: http://thinkphp.ro | |
G+ : http://gplus.to/thinkphp | |
MIT Style License | |
input.txt: | |
2 4 6 8 0 0 0 0 0 | |
3 5 7 9 0 0 0 0 0 | |
|| |
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
''' | |
Calculate the value of PI using Infinite Series | |
Twitter: @thinkphp | |
Website: http://thinkphp.ro | |
G+ : http://gplus.to/thinkphp | |
MIT Style License | |
4*(1- 1/3 + 1/5 - 1/7 + 1/9 +...) | |
''' | |
import math |
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
''' | |
Computes the value of e(2.718281827...) using infinite series | |
Twitter: @thinkphp | |
Website: http://thinkphp.ro | |
G+ : http://gplus.to/thinkphp | |
MIT Style License | |
1 + 1/1! + 1/2! + 1/3! + ... | |
2 + 1/2! + 1/3!+ ... | |
''' |