As a follow up to my last article here is the sample implementation of a max heap, that means you will always have a maximum value at the root node. With simple changes one can reverse this behavior if required.
Most common use of binary heaps as a backing data structure in implementation of Priority queues, the reason they are better is though array backed priority queues have fast access times O(1) they have very slow insert times O(N) because each element of an array needs…
O(1)
O(N)
Recently I have been working on refactoring an existing code base, which resulted in quite a number of pull requests each of which originated from own branch, which of course…
Today we will talk about modules in node. Modules are the building block of any node application and are loaded by using require statement or import statement if you are using ES6 Javascript code.
So it’s Easter and we have a long weekend this year. Naturally you get some extra time on your hands and what is better than setting up your own streaming server on the cloud. Typically my workflow consists of several steps if i am…
For security reasons you should not have your database available to the internet just protected by some password, it should be available only from within your VPC.
So there is a gotcha when sorting arrays integer arrays in Javascript.
For example if you have an array
``` x = [ 1, 10, 2, 5 ]```doing x.sort() will return
We recently ran into some issue regarding the number of open connections on one of our RabbitMQ servers, the number of socket connections was totally exhausted, and this prevented new clients from connecting to the…
There are times when you would need to apply this technique be it if you are trying to escape some draconian rules of your network admin or for testing your site from a different location to the desire of browsing anonymously. In my case the need arose when I had to test some…
To clear your DNS cache you can run the following command, this will force browser and other programs to make a new DNS query and fetch fresh records.
```sudo dscacheutil -flushcache```