Computing desk | ||
---|---|---|
< July 8 | << Jun | July | Aug >> | July 10 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
I am interested in running Line Mode Browser on the latest version of Windows 10. Has anyone ported it? Failing that, has anyone ported it to an environment that has an emulator for Windows 10? I can't find a compiled version that runs on anything. Yet the image on our Line Mode Browser page shows that someone managed to read Wikipedia using it... --Guy Macon (talk) 12:10, 9 July 2017 (UTC)
I wish to type datas in the PC than transfer it to the Smart Phone, vice versa (also wish to type in the Smart Phone than transfer it to the PC), off-line. Could you refer me to any apps that could be synchronised using WiFi and or as well as Bluetooth in order to perform stated task
The following is what I seek: MS Outlook’s Calender, Tasks, Notes, Contacts.
Note: I’ve used many apps but ‘writing on PC than transferring it to the Smart Phone, also writing it on the Smart Phone than transfer it to the PC’ is a desired thing, what I’m unable to find. Could you refer me to something good please?
116.58.201.114 (talk) 15:52, 9 July 2017 (UTC)
I am a hobby programmer, and I do not know all the terms of a pro computer scientist.
I have been thinking about the problem of maintaining k running quantiles, say over a window of. e.g., n = 8192 samples as computationally and memory efficient as possible. The samples coming in are quite unordered.
I realize, that if I only had to maintain a single running quantile, such as the running sample median, a good procedure would be to maintain a max-heap and a min-heap as priority queues, where the max-heap would be used for adding and removing elements with a values less than or equal to the current median, and the min-heap would be used for adding and removing elements with values larger than the median. By keeping track on the number of values added to either heap, elements can then be transferred along the way between the two heaps to assure they contain an equal number of elements (min heap one less for uneven sample sizes) and their roots can be used to find the median.
If I want to maintain k running quantiles, e.g., 10%, 20%,..., 90% (k=8). I could allocate k min-heaps and k max-heaps using k x n x sizeof(element) storage.
However, I am looking for an efficient solution, where I do not have to scale the memory and heap operations by a factor of k 'just' because I want to maintain k concurrent running quantiles.
For that purpose I tried to look into maintaining an 'enriched' binary search tree, where each node besides left and right references also has low and high references to nodes, which would refer directly to the next and previous nodes in a sorted list of all nodes, wothout having to traverse the tree in a classical tree search. This is convenient because the current quantiles can be maintained as k pointers to nodes containing the k running quantile values. If supplemented by counters to maintain how many elements are in the tree with values below each of the k quantile nodes, the quantiles can be maintained by moving it to quantile.high, if the sample count below the node becomes too small. Or point to quantile.lo if the number of sample points below the quantile node exceed the sample quantile.
It is not that hard to maintain the extra low/high pointers. I made a prototype implementation is Python where I just add values and maintain just a running median this way, and it seems to work. Here I have just the code for maintaining the 'enriched' BST tree when adding elements in order to not make things too complicated.
class Node:
def __init__(self, data, lo=None, hi=None, left=None, right=None):
self.data = data
# Number of data values added
self.count = 1
# Linked list to Node with next lower value if all nodes were sorted
self.lo = lo
# Linked list to Node with next higher value if all nodes are sorted
self.hi = hi
# Node in binary search tree, with a lower value
self.left = left
# Node in binary search tree with a higher value
self.right = right
# If left and right nodes are None, the node is a leaf in the BST
class Tree:
def __init__(self):
self.root = None
def add(self, data):
if self.root is None:
self.root = Node(data)
else:
current = self.root
while True:
if data < current.data:
if current.left is None:
nd = Node(data, lo=current.lo, hi=current)
if current.lo is not None:
current.lo.hi = nd
current.lo = nd
current.left = nd
break
else:
current = current.left
elif data > current.data:
if current.right is None:
nd = Node(data, lo=current, hi=current.hi)
if current.hi is not None:
current.hi.lo = nd
current.hi = nd
current.right = nd
break
else:
current = current.right
elif data == current.data:
current.count += 1
break
def remove(self, data):
...
Now, this implementation is slow because
However regarding allocation, a fixed memory area of size n x sizeof(node data structure) could just be preallocated and a queue be maintained to keep track of vacant indices of nodes. Secondly this does not need to be implemented as objects, but can be maintained as lists of tuples of a fixed format.
As far as I can see adding/deleting a node is O(log(n)) (assuming the tree is fairly balanced, which is a reasonable assumption as the data I have in mind are unsorted on reception) and finding the lower/higher sorted element is O(1), so this seems very efficient for maintaining the k quantiles in O(log(n) + k) time.
I am sure I am not the first to consider such an 'enriched' binary search tree.
Does this kind of sequentially sorted binary search tree have a name?
Is there a better way to solve the same problem of maintaining k running quantiles?
-- Slaunger (talk) 20:42, 9 July 2017 (UTC)
Hello. I am coding some Javascript and I keep hitting a roadblock. Is there a forum somewhere that will allow me to post the troubling code and someone will tell me what I am doing wrong? → Michael J Ⓣ Ⓒ Ⓜ 22:52, 9 July 2017 (UTC)