Posts

Showing posts from December 24, 2018

Find the number of elements larger than a given element in BST

Image
0 I'm trying to solve the Hackerrank's Insertion Sort Advanced Analysis problem using BST (similar to this question on SO). As I put items in the tree, I need to find out the number of items greater than it (the get_rank() method in the code): class Node: def __init__(self, data): self.left = None self.right = None self.data = data self.num_left_children = 0 self.num_right_children = 0 def insert(self, data): if data <= self.data: if self.left is None: self.left = Node(data) else: self.left.insert(data) self.num_left_children += 1 else: if self.right is None: self.right = Node(data) else: self.right.inse

Enable BFQ in Fedora

Image
4 1 I am running Fedora with the stock kernel and I'd like to enable the BFQ disk I/O scheduler, and ideally BFS. I have built my own kernel and that works, though it is a royal pain dealing with the Nvidia drivers. Can I enable BFQ and BFS without building my own kernel, such as by adding kernel args to grub? If not, is there a kernel package available that supports this? fedora linux-kernel scheduling share | improve this question asked Jul 22 '14 at 22:18 Freedom_Ben 774 2 13 19