Need Javascript Recursive function Urgent !

Đã Hủy Đã đăng vào 6 năm trước Thanh toán khi bàn giao
Đã Hủy Thanh toán khi bàn giao

In attachment, you will find an Excel sheet with 5 columns.

Columns A and E are not important.

Column B are the parents of their children in columns C in quantity of column D.

For exemple, parent 12 has one child which is 13 (qty 3), which in turn has 4 children 15,16,17,18 (qty 1 each).

Beware : 13 has another parent (11 - qty 1), which means that the cumulated quantity of 15, 16, 17, 18 is 4 each in total, if we consider that 13 goes into 11 (1x) and into 13 (3x).

I need two recursive functions :

1) Create a tree where each root includes a "children" array containing its respective child_id and qty. For example, 13 and it children must appear twice, once under 11 and once under 12.

Parameters :

- array of links with parent_id, child_id, quantity

- root node (if not mentionned, take the one with parent = null)

2) Create a list of use cases. For each child, determine the path to the root and the cumulated quantity.

Parameters :

- array of links with parent_id, child_id, quantity

- root node (if not mentionned, take the one with parent = null)

Example for root = 11:

child_id: 15, root_id: 13, cumulatedQty: 1, path: [{level:1, child_id: 15, parent_id: 13, qty: 1}]

child_id: 15, root_id: 12, cumulatedQty: 3, path: [{level:1, child_id: 15, parent_id: 13, qty: 1}, {level:2, child_id: 13, parent_id: 12, qty: 3}]

child_id: 15, root_id: 11, cumulatedQty: 4, path: [{level:1, child_id: 15, parent_id: 13, qty: 1}, {level:2, child_id: 13, parent_id: 12, qty: 3}, {level:2, child_id: 13, parent_id: 11, qty: 1}, {level:3, child_id: 12, parent_id: 11, qty: 1}]

Deliverables : 2 functions, testable in JSFiddle or similar.

Very ugent. Thanks.

Didier

JavaScript jQuery / Prototype

ID dự án: #15175917

Về dự án

24 đề xuất Dự án từ xa 6 năm trước đang mở

24 freelancer chào giá trung bình$157 cho công việc này

riteshjain009

//**READY TO START RIGHT AWAY **// You are looking for someone to fix the JS function. Relevant Skills and Experience We are having more then 5+ years of experience . We did over 200 websites so very much suitable to Thêm

$166 USD trong 1 ngày
(65 Nhận xét)
6.9
hawkscodeaus

I have 7+ years in javascript - jquery developers with very good experience. Relevant Skills and Experience I am good in Javascript, jQuery / Prototype Proposed Milestones $200 USD - Cost

$200 USD trong 3 ngày
(63 Nhận xét)
7.1
ravinder246

Hello, I have great experience in javascript and can do these 2 recursive functions related work perfectly. let me know when can we start the work Relevant Skills and Experience javascript Yes I have strong knowled Thêm

$150 USD trong 2 ngày
(190 Nhận xét)
7.2
MyAwesomeTeam

Nice to meet you, dstadel3. do you need two recursive functions : 1) create a tree where each root includes a "children" array containing its respective child_id and qty ?.I can help you Our skills sam Thêm

$165 USD trong 6 ngày
(88 Nhận xét)
6.5
sunnysmile911

Hi I am interested in this project. I am high skilled at HTML5 and Javascript programming. I am also good at algorithmic problems. Let us discuss in detail Thank you Relevant Skills and Experience Javascript Proposed Thêm

$222 USD trong 3 ngày
(7 Nhận xét)
5.7
vranjan

From your brief description I noticed that you the javascript developer and I have more than 8 years of experience in javascript. Relevant Skills and Experience Expert in PHP-OOP,CakePHP,Wordpress, MVC, REST API, H Thêm

$290 USD trong 3 ngày
(17 Nhận xét)
5.4
asadrana91

A proposal has not yet been provided

$220 USD trong 1 ngày
(10 Nhận xét)
4.4
imRaziel

hi. i can do it, but i have a few question Relevant Skills and Experience i know javascript Proposed Milestones $100 USD - program how are you planning to access that .xlsx file from a script? is it possible to make Thêm

$100 USD trong 1 ngày
(18 Nhận xét)
4.5
popcon205

Consider it Done ! We are experts in Joomla, Wordpress, Core PHP, MYSQL, Javascript, JQuery / Prototype, AJAX, Programing, HTML, CSS, Bootstrap technologies, Software Architecture and Software Development. We are certi Thêm

$155 USD trong 3 ngày
(7 Nhận xét)
4.1
yogisharma66

Hey there, i have read your description and confident enough to complete it with the elite quality. Relevant Skills and Experience PHP, HTML, CSS, WordPress, Joomla, Magento, JQuery, AJAX etc Proposed Milestones $155 Thêm

$155 USD trong 3 ngày
(2 Nhận xét)
3.5
lupascudan

Hello. I can help you with this project. I can start as soon as you want. I just want to clear something out. What should exactly the functions return? We can discuss everything if you contact me. Regards, Dan.

$100 USD trong 1 ngày
(6 Nhận xét)
3.7
freelancerkpis

We are happy to bid on this project. We provides dedicate developers and Development and design services as well. ***** We are having a great team of Mobile developers with 7-8 years of experience Relevant Skills a Thêm

$155 USD trong 3 ngày
(3 Nhận xét)
2.9
bistanil98

want to discuss this in detail before start this project, as we have team of professionals so we can manage this project,but first have a chat on this. Relevant Skills and Experience Skills :- Javascript, jQuery Pro Thêm

$135 USD trong 4 ngày
(10 Nhận xét)
6.4
SachinEkrocx

I have read your job description and I am very much comfortable to work on your project so kindly have a chat with me for further discussion. Relevant Skills and Experience Photoshop, HTML5, CSS3, Bootstrap, Javascri Thêm

$100 USD trong 1 ngày
(0 Nhận xét)
0.0
wal005

A proposal has not yet been provided

$155 USD trong 3 ngày
(0 Nhận xét)
0.0
hemanghumwala

A proposal has not yet been provided

$137 USD trong 4 ngày
(0 Nhận xét)
0.0