Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,152,466 members, 7,816,091 topics. Date: Friday, 03 May 2024 at 04:13 AM |
Nairaland Forum / Romme2u's Profile / Romme2u's Posts
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 43 pages)
Politics / Re: Buhari: I Have Been Fair To Igbo Despite Low Votes by romme2u: 11:35am On Jan 09, 2019 |
hungryboy: baba longest time............... |
Fashion / Re: Khadija Ben Hamou Becomes First Black Miss Algeria (Pics, Video) by romme2u: 11:20am On Jan 09, 2019 |
1 Like |
Politics / Re: Politicians Buying Pvcs From Voters – INEC Chair by romme2u: 10:47am On Jan 08, 2019 |
StOla: Apart from ur bmc 30k, how much of the APC dollar sleaze have u taken |
Politics / Re: Blame PDP, Private Sector For Job Losses Not Buhari — APC by romme2u: 5:09pm On Jan 03, 2019 |
Romance / Re: Nigerian Men, Please Stop Showing Us Your Dick All In The Name Of Urinating. Pix by romme2u: 3:29pm On Dec 25, 2018 |
Romance / Re: Lady Dumped By Her Boyfriend After Sex & Eating Her Mum’s Chicken by romme2u: 11:36am On Dec 25, 2018 |
Family / Re: Wife Writes 'Borrow' Whenever She Sends Her Husband Money by romme2u: 11:28am On Dec 25, 2018 |
desoul2004: signs of deluded wanna be feminists 1 Like |
Family / Re: Wife Writes 'Borrow' Whenever She Sends Her Husband Money by romme2u: 11:26am On Dec 25, 2018 |
Michelle55: Are you informing me OR inviting me BTW i need to see the real bum-bum whether it can sit, bend, crouch, rock, twerk or squat |
Family / Re: Wife Writes 'Borrow' Whenever She Sends Her Husband Money by romme2u: 9:03am On Dec 25, 2018 |
Michelle55: where do you think you are going with this flat n empty bum-bum |
Sports / Re: Look At This Cartoon On Goal Website Hitting Back At Pele For Messi Criticism by romme2u: 1:48pm On Dec 11, 2018 |
chiboy1116: the famed one touch master messi fans sha |
Romance / Re: Checkout This Street In Rwanda (photo) by romme2u: 1:36pm On Dec 11, 2018 |
lefulefu: Even in the animal farm, some characters were still shouting...... Napoleon is always right ..........and guess what? those characters still exist in this jungle |
Romance / Re: Checkout This Street In Rwanda (photo) by romme2u: 11:57am On Dec 11, 2018 |
lefulefu: Why won't they leave us behind, when we brought an ancestor to reverse the little progress we were making for the past 16 years (in the name of fighting corruption). yes we were advancing though at a slow pace but the economy was expanding and infrastructures were being revamped slowly and steadily then boom........2015 happened and the country slipped in every indices of human development promoting us to the poverty capital of the world. 1 Like |
Politics / Re: Shocking: See The Number Of Tradermoni National Assembly Budget Could Benefit by romme2u: 11:40am On Dec 11, 2018 |
why don't we share the national budget so that every citizen will benefit from tradermoni mtcheeeew |
Celebrities / Re: Teenage Actress, Rosemond Brown Blasted For Showing Off Her Bushy Private Part by romme2u: 11:38am On Dec 11, 2018 |
Romance / Re: What Kind Of Sex Style Will They Like? Photo Included by romme2u: 10:39am On Dec 11, 2018 |
BlackPantherxXx: all work and no play makes jack a dull man |
Romance / Re: Nairaland Guys And Careers by romme2u: 10:35am On Dec 11, 2018 |
funmisticqueen: if we don't yuck pussy, wetin we gain |
Foreign Affairs / Re: If US Develops Banned Missiles, So Will Russia ::PUTIN by romme2u: 6:37pm On Dec 07, 2018 |
Temple1288: your ignorance stinks man 5 Likes 2 Shares |
Romance / Re: Mr Harri Best Marries His Guitar In Lagos State (Photos) by romme2u: 11:06pm On Nov 30, 2018 |
Michelle55: for ur church mind....................you sef dey follow find better machine u think say e dey show for face or by moniker |
Foreign Affairs / Re: Which Country Does Israel Fear The Most And Why? by romme2u: 6:50pm On Nov 29, 2018 |
sighs another brainwashed soul with an empty brain 2 Likes 2 Shares |
Romance / Re: Mr Harri Best Marries His Guitar In Lagos State (Photos) by romme2u: 6:12pm On Nov 29, 2018 |
Foreign Affairs / Re: Africa Is Just A Cementary For Africans - Russian President Vladimir Putin by romme2u: 5:32am On Nov 26, 2018 |
oyin44: With buhari and IBB as case study |
Foreign Affairs / Re: Was Putin Wrong To Say This About Africa? by romme2u: 5:29am On Nov 26, 2018 |
Politics / Re: Edo State Should Be The Capital Of South-South by romme2u: 5:01am On Nov 26, 2018 |
28 Likes 1 Share |
Politics / Re: Boko Haram: NAF Pounds Sect In Metele, Location Of Deadly Attack On Soldiers by romme2u: 4:32am On Nov 26, 2018 |
Army cyber warfare group aka propaganda brigade test running their systems 18 Likes 4 Shares |
Politics / Re: Buhari’s Govt Ignored Intelligence Warnings About Boko Haram, Says S’african Mer by romme2u: 3:13am On Nov 26, 2018 |
Intelligence and this government are miles apart This game of greed n betrayal won't end well for Africa 12 Likes |
Programming / Re: Object Oriented Programming by romme2u: 3:00am On Nov 26, 2018 |
Google Object oriented thought process by matt weissfeld What is OOP at tonymarston.net blog |
Programming / Learning Programming? The Common Misconception About Oop by romme2u: 1:28pm On Nov 02, 2018 |
As a regular visitor on this board for almost a decade even before I register as a member years later, I have always seen the thread “I want to learn programming, which language should I start with” which is sticky BTW but I never bothered to open it. Yester-night out of curiosity, I decided to skim through the first 20 pages of the thread. Javanian made an excellent intro specifying the various programming platforms and the language suited for each platform as well as the tasks they excel in, and as is common on topics of such nature, it degenerated into language fights and supremacy. Yes, majority of programmers are emotionally attached to their language of choice, no matter its flaws and frailties. But languages keep evolving, adding and removing features as the case may be else it tows the path of BASIC, COBOL, FORTRAN or even the mighty PERL. But I noticed a disturbing and reoccurring misconception about OOP from the comments of some professionals and guides. Since a lot of people started programming from OO concept, they don’t really understand the major differences between Objected-oriented programming (aka Classical) and structured programming (famous as procedural). If you’ve ever done procedural (structured) programming with C or PHP, you’ll appreciate and understand the sanity and flexibility OOP brings to programs; though some developers are still stuck with procedural style of programming, claiming that no language is completely OO without vestiges of procedural design. Late 2009 when I dived head-long into programming, the first book I read was language-agnostic titled “Object-Oriented Thought Process” by Matt Weisfeld though C (procedural) was the first language I learnt some months later. The author took time to explain the OO concept without leaning to any language model. Using examples from C#, JAVA and VB.NET, he explained Encapsulation, Inheritance and Polymorphism as the core concept of OOP. He dissected the differences between procedural (structured) and OO design/analysis, and why programs should be designed and built using OO concepts. I highly recommend this book to people who intend to learn OR are learning any modern OOP language like C#, JAVA, RUBY, PYTHON, PHP and even JAVASCRIPT (though this is not a classical language but prototypal which is object-based). You will gain a deeper understanding of OOP concepts and program design/analysis. NOTE: since C++ is a superset of C, it consists of both structured and OOP concepts/features 3 Likes |
Politics / Re: Atiku's Son Doesn't Work In A Pure Water Factory, His Father Owns It by romme2u: 12:55am On Oct 31, 2018 |
Politics / Re: Atiku's Son Doesn't Work In A Pure Water Factory, His Father Owns It by romme2u: 2:10pm On Oct 30, 2018 |
SeverusSnape: welcome bro long time no see 2 Likes |
Politics / Re: Atiku's Son Doesn't Work In A Pure Water Factory, His Father Owns It by romme2u: 2:09pm On Oct 30, 2018 |
yeyeboi: BABA abeg no vex....are u yeyerolling? cos i can't understand una again |
Programming / Re: Brain Teaser: Recursive Anonymous Function Expression Analysis by romme2u: 1:56am On Oct 20, 2018 |
Programming / Brain Teaser: Recursive Anonymous Function Expression Analysis by romme2u: 1:51am On Oct 20, 2018 |
I have over-studied in recent weeks as I’ve read more than I write (code) There is a technique that has been flying over my head for over a year (probably because I didn’t take it serious at first). I came across it in Douglas Crockford’s “JavaScript the Good Parts” while studying advanced function techniques late last year. Here is a sample:
Here is it counterpart in PHP (Source – User Comment on PHP online manual):
Both piece of code uses same technique (Recursive Anonymous Function Expression) to solve two different problems. My issue is not recursive functions as I understand the concept. But since recursive function usually suffers from memory constraint and can most time be rewritten as iterative, I have never used it as iteration presents a more readable code to me. It seems the PHP code uses the Tower of Hanoi concept to rearrange the data structure. It is just a guess, I’m not really sure. Modified Thanks Nmeri17, the question didn't fit the Q&A format required by stack overflow.........I just needed to reword the question, sorry for the oversight. I have also provided context and expected data structure The correct question should be Convert these Recursive functions to Iterative functions (rewrite as) I understand that some problems suit recursive technique more than iterative but i just need an insight |
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 43 pages)
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 49 |