1

I was wondering if I would be able to use specific parts of the c++ library for my arduino sketch. For example the arduino library has a queue array but I wanted to use a priority queue for my sketch and I am unsure how to modify the queue header file to do that. Also if I can use the priority queue from the c++ library can you please tell me how I would go about doing that.

Thank-you

  • 1
    There is no priority queue on the Arduino - and for a good reason: these kind of things really aren't suitable for small microcontrollers with limited resources. While it may be possible to roll your own it most likely isn't the right thing to do - instead you should think about what you are actually trying to achieve and consider if this is really the right way to go about it. – Majenko Mar 9 '16 at 18:21
  • Hi Majenko thanks for answering. Do you know if there is an arraylist implementation. I am trying to implement djikistra's algorithm. I was able to do a bfs just with the use of an array, but djikistra's gets a little complicated when using just arrays. I think I can work with an arraylist if arduino has it. @Majenko – Major Ben Mar 9 '16 at 19:16
  • It may be time to teach yourself linked lists... – Majenko Mar 9 '16 at 21:49
  • Does the arduino library include linked lists @Majenko – Major Ben Mar 10 '16 at 0:35
  • No, they are a basic concept of C, not a library function. – Majenko Mar 10 '16 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.