Questions tagged [rmq]

Given an array A[1,n] of n objects taken from a well-ordered set (such as numbers), a Range Minimum Query (or RMQ) from i to j asks for the position of a minimum element in the sub-array A[i,j].

Given an array A[1,n] of n objects taken from a well-ordered set (such as numbers), a Range Minimum Query (or RMQ) from i to j asks for the position of a minimum element in the sub-array A[i,j].

More info: Wikipedia

67 questions
1
vote
2 answers

complexity of single change in array that is maintained with a static Range Minimum Query

I had a test in the data structures course and one of the questions was: lets say you have an n-size array that is maintained with a Range Minimum Query that gives the minimum between two numbers in the array in o(1) complexity. of course the array…
user76508
  • 267
  • 2
  • 8
1
vote
0 answers

Minimum/Maximum value in a Binary Indexed Tree

I know how a BIT works. But I was wondering if a BIT can be used to find the minimum/maximum element in the complete range, or more specifically, to find the minimum (or maximum) value after all the update processes have been completed. Now, I know…
Born Again
  • 2,139
  • 4
  • 25
  • 27
1
vote
0 answers

2D RMQ Range Tree

Hi I'm trying to implement a 2D range tree for rmq-ing, here's my code, i think it's not efficient enough, is there anything i can do for optimation. ls contain list of y sorted on every node rt contain a segment tree p.fi.fi contain x…
zeulb
  • 637
  • 1
  • 7
  • 23
1
vote
2 answers

storage time in segment tree

I want to know how many nodes are there in a segment tree made for solving range minimum query problem. Also, how much time does the build operation take and why?
vishalgoel
  • 69
  • 4
0
votes
1 answer

Can we move RMQ messages in batches to another RMQ using shovel(dynamic)?

I wrote a script which uses RMQ shovel's PUT api to move messages to another RMQ but I was wondering about how it works internally. Does it move all the messages instantaneously? If yes, can we move it in batches for optimising it?
Vid
  • 123
  • 11
0
votes
2 answers

How to see RabbitMQ messages

Can't view rabbitmq queue messages after using the get messages command. rabbitmqadmin get queue='queue_name' -H localhost -P 15672 -u rmq -p rmq --vhost=/ count=100 Queue count shows 100 messages, cant use the above command again to see the…
Deepan
  • 119
  • 1
  • 2
  • 8
0
votes
1 answer

How to pause and resume RMQ consumer in Java

RMQConsumer in my code is a spring bean which is initialised at the time of Spring container initialisation. It starts listening to RMQ messages on the queue as soon that Spring bean is ready irrespective of the whole Spring container is ready or…
vinit
  • 41
  • 6
0
votes
1 answer

Range Minimum Query for growing array

I have an array A[0..n] and I need to find the minimum value in the interval A[k₀..n]. Based on that, the array is extended with a value A[n+1] and I need the minimum in A[k₁..n+1]. Again the array is extended with some A[n+2] and queried for the…
phs
  • 541
  • 3
  • 18
0
votes
1 answer

Spring AMQP - Publisher Confirms not closing unused channels

Publishing and getting acks/nacks is working as expected. My concern here is, it is not closing extra channels which are not in use. On the other hand with Publisher Confirms set to false the unused channels are getting closed as expected.…
Sravya
  • 3
  • 1
0
votes
0 answers

Intermittent error in sending messages to RabbitMQ

We are getting below error when trying to send message to RabbitMQ. Our application is on .net core 3.0 on linux VM, and the RMQ server is running in a cluster of two on linux VMs. The issue is intermittent and not happening always. Already closed:…
Nitin Jain
  • 289
  • 2
  • 9
0
votes
0 answers

Automatic re-declaration/recovery of queue in RabbitMQ

I have RabbitMQ queue consumer application in java. Below is the code snippet for declaring queue: public static void declareQueue(final String rmqQueueName) { try { Map args = new HashMap<>(); …
abn
  • 41
  • 1
  • 8
0
votes
1 answer

segment tree correct but query output is not

I tried to implement segment tree algorithm for finding range minimum query in Java. Here is my complete java code. It builds the segment tree from an array. and then prints the minimum element in every range. the problem is, tree is correct (as far…
0
votes
2 answers

Get transferred file name in RabbitMQ using python pika

I'm using pika in Python3 to send CSV files from one node to another and everything is fine here. The only thing I need here is to get the transferred file name in the receiving node (e.g: filename-2017-01-01.csv) Are there any ways to do…
Narbeh
  • 28
  • 6
0
votes
1 answer

Why solving a range minimum query with segment tree time complexity is O(Log n)?

i was trying to solve how to find in a given array and two indexes the minimum value between these two indexes in O(Log(n)). i saw the solution of using a segment-tree but couldn't understand why the time complexity for this solution is O(Logn)…
0
votes
1 answer

Range Minimum Query above a constant value

Given an array of n elements . Find minimum value of element in range [l...r] such that a[k]> p . ( l<=k<=r and p varies with each l and r). Is there any solution that works in log(N)?