Skip to content Skip to sidebar Skip to footer
Showing posts with the label Algorithm

Is There A Formula For Calculating Or Estimating The Number Of Digits Of A Binary Integer?

ex : base 10(999) => 3 digits === base 2(1111100111) => 10 digits I am currently using a ta… Read more Is There A Formula For Calculating Or Estimating The Number Of Digits Of A Binary Integer?

Merge Two Arrays And Sort The Final One

In an interview I was asked the following question. I am given two arrays, both of them are sorted… Read more Merge Two Arrays And Sort The Final One

Algorithm To Re-index An Array Of Objects After Insertion Or Drag 'n' Drop Order Change

Assume I have an indexed array of objects, such as these containing lines of a popular folk song ;)… Read more Algorithm To Re-index An Array Of Objects After Insertion Or Drag 'n' Drop Order Change

Javascript Algorithms: Find Starting And Ending Indices Of Consecutively Repeated Chars From A String

I wanted to function a function that does this: const input =“hellooooloo”; const results = getRepe… Read more Javascript Algorithms: Find Starting And Ending Indices Of Consecutively Repeated Chars From A String

Returning The Length Of The Shortest Word In A String In Javascript

I'm trying to write a function that returns the length of the shortest word in a string. It onl… Read more Returning The Length Of The Shortest Word In A String In Javascript

Finding All Connected Components Of An Undirected Graph

I have a list of objects (undirected edges) like below: pairs = [ pair:['a2', 'a5'… Read more Finding All Connected Components Of An Undirected Graph

Shift An Array And Rendering It In A Html List

Using the following script I am not able to swift and set the focus for an array back in the list w… Read more Shift An Array And Rendering It In A Html List

Algorith Problem Decode Hex To Set Output

I got an algorithm that I need to solve. Unfortunately, I can't even find a clue about a soluti… Read more Algorith Problem Decode Hex To Set Output

How To Rearrange An Array By Indices Array (proof)?

Given an array arr and an array of indices ind, the following algorithm rearranges arr in-place to … Read more How To Rearrange An Array By Indices Array (proof)?

Calculate Distance To Move A Box To Remove Intersection

I have two boxes that are overlapping and I want to figure out how to move one to remove the inters… Read more Calculate Distance To Move A Box To Remove Intersection

Seat Guests Based On Prioritized Parameters

The following data model represents tables with seats and guests, in an application that lets a use… Read more Seat Guests Based On Prioritized Parameters

Javascript Tree Search Algorithm Which Return Subset Of The Tree Which Contains The Found Term And Its Parents

I have a tree selection in which every node has a name. I want to search through the node names and… Read more Javascript Tree Search Algorithm Which Return Subset Of The Tree Which Contains The Found Term And Its Parents

Complex Table Merging Javascript & Jquery Algorithm

I have a rather unique problem that I'm having trouble solving. I have a 2 x 3 table, arranged … Read more Complex Table Merging Javascript & Jquery Algorithm

Diamond-square Algorithm Not Working (rewrite Code From Js To Java)

I am trying rewrite code from JS to Java. The code is Diamond square algorithm. Source is: http://w… Read more Diamond-square Algorithm Not Working (rewrite Code From Js To Java)

Why Modular Exponentiation Functions Work Differently In Python And Javascript For Large Numbers?

I need to perform modular exponentiation on quite large numbers on both python3 and javascript. I h… Read more Why Modular Exponentiation Functions Work Differently In Python And Javascript For Large Numbers?

Allocate Bikes To People - First Priority (closest Bike To Closest Person)

Passing in a grid to a function with bikes and person at locations [ 'c' , '_' ,… Read more Allocate Bikes To People - First Priority (closest Bike To Closest Person)

Find Free Port Not In Use For Apps - Find Some Algorithm

I use the following API in my program to detrmine free port and provide it to application to run po… Read more Find Free Port Not In Use For Apps - Find Some Algorithm

Javascript: Algorithm For Sorting Based On An Predefined Order Of Regexes

I want to sort an array of clothing sizes based on an predefined order of regular expressions. The … Read more Javascript: Algorithm For Sorting Based On An Predefined Order Of Regexes

Roman Numeral Translator Using Javascript

I got this to work without using underscore, but as an extra challenge I'm trying to convert Ro… Read more Roman Numeral Translator Using Javascript

How To Check If A Possible Path Exist?

I'm working on an experimental javascript-based game. Player has to travel to exit on a 2-dimen… Read more How To Check If A Possible Path Exist?