Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,466 members, 7,816,091 topics. Date: Friday, 03 May 2024 at 04:13 AM

Romme2u's Posts

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:
No be lie were Amaechi talk say, this man no dey read, and him no sabi book.
appointing ministers from every state is not a favour but a right, according to our Federal Character law.
And being the President of a country means, treating every region fairly, not minding who gave you more or less votes.

cool


baba longest time...............
Fashion / Re: Khadija Ben Hamou Becomes First Black Miss Algeria (Pics, Video) by romme2u: 11:20am On Jan 09, 2019
Chubhie:
Nice prominent cheekbones.

cool




very charming and alluring

1 Like

Politics / Re: Politicians Buying Pvcs From Voters – INEC Chair by romme2u: 10:47am On Jan 08, 2019
StOla:



Atiku must bring out all his dollars and aimlessly spend it on Nigerians whose future was stolen.

I urge you to take your own share too.

angry


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
madridguy:
tongue

undecided

speechless eh

smh
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
1Sharon:
And they wonder why Nigeria smells like a dump


angry

just negode
Romance / Re: Lady Dumped By Her Boyfriend After Sex & Eating Her Mum’s Chicken by romme2u: 11:36am On Dec 25, 2018
OboOlora:
Ok

sad


is that all
Family / Re: Wife Writes 'Borrow' Whenever She Sends Her Husband Money by romme2u: 11:28am On Dec 25, 2018
desoul2004:


Why can't you stop exposing your ignorance.
Writing a full page saying a trash.

grin grin


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:
cheesy I agree it's flat, atleast I can still sit down with it na. Anyways, I'm going to eat Xmas rice that mama sukura is preparing

undecided

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 cool
Family / Re: Wife Writes 'Borrow' Whenever She Sends Her Husband Money by romme2u: 9:03am On Dec 25, 2018
Michelle55:
cheesy why should he pay back? He's your husband and whatever you have belongs to him...vice versa. So drop the idea of disgracing him on social media. We're one complicated species sef, if the man go borrow am from another woman, we no go hear word. Now he decides to do it right by asking it from you as his partner yet you are still complaining. Nawa oh!
Abeg lemme coman be going

sad
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:
inzhagi was mad ...guy man go touch ball 15 times for 80mins score hatrick...lolx

cool
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:

and ppl are still shouting sai baba as the country is getting more backward

embarassed

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:
Many african countries are leaving nigeria behind while nigeria is far going back to the stone ages.

embarassed


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
sad



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
youngberry001:
Mheen is that pussy in between her legs shocked

undecided

nooooo its ssypu
Romance / Re: What Kind Of Sex Style Will They Like? Photo Included by romme2u: 10:39am On Dec 11, 2018
BlackPantherxXx:


Haba...i felt you were into politics only!

grin grin

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:
it is not their fault, pussy they came from and pussy they must go to

sad

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:
A country where only the few that are allies to Putin are rich. He should concentrate on the well-being of his people as most of them poor and very poor!

Just a few (friends to his harsh government) are rich.. You don't see Japan talk about wars cuz they're busy developing their country... He should emulate from them!

sad

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:

See them!!! So if dem call people wey get better machine to come out, you sef go follow too?

sad

for ur church mind....................you sef dey follow find better machine

u think say e dey show for face or by moniker undecided
Foreign Affairs / Re: Which Country Does Israel Fear The Most And Why? by romme2u: 6:50pm On Nov 29, 2018
sad

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
Michelle55:
cheesy Everything is not all about fvck

undecided

But its the center of gravity
Foreign Affairs / Re: Africa Is Just A Cementary For Africans - Russian President Vladimir Putin by romme2u: 5:32am On Nov 26, 2018
oyin44:
Correct..l don't know why we like corruption more than any thing.

angry

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
MissRaine69:
What are your views on this?

undecided

Take buhari and IBB as a case study
Politics / Re: Edo State Should Be The Capital Of South-South by romme2u: 5:01am On Nov 26, 2018
BlowBack:
The OP don run grin grin grin grin

grin grin

Guy u wicked, u just finished op career grin grin

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
angry

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
sad

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
yeyeboi:




I’m not yeyerolling

lipsrsealed

hmm wonderful
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:
That's cool.

His father is an employer of labour, unlike one terrorist who employs herdsmen to kill.

Even at that, he doesn't own a 50 million naira bike, unlike Buhari's son.

cheesy

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:




Try something else by Gee this one no go work , we are atikulated

grin

BABA abeg no vex....are u yeyerolling?

cos i can't understand una again grin grin grin
Programming / Re: Brain Teaser: Recursive Anonymous Function Expression Analysis by romme2u: 1:56am On Oct 20, 2018
embarassed
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) grin grin

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:


//JS Memoization
//memo is a one dimensional array for storing pre-defined numbers.......
//the function returns a value if it already exists in the array.......
//.......else generate and store a value for future use, then return the generated value
var memoizer = function (memo, fundamental) {
var shell = function (n) {
var result = memo[n];
if (typeof result !== 'number') {
result = fundamental(shell, n);
memo[n] = result;
}
return result;
};
return shell;
};
//fundamental function can be a Factorial, Fibonacci series generator, fetching data over a network or any processor intensive task



Here is it counterpart in PHP (Source – User Comment on PHP online manual):


//PHP Multi-Dimension Array Restructuring --- handles 2D to nD arrays as memory permits
//Designed to rearrange $_FILES superglobal from associative to numeric array when multiple files are uploaded at once
function get_fixed_files() {
$function = function($files, $fixed_files = [], $path = []) use (&$function) {
foreach ($files as $key => $value) {
$temp = $path;
$temp[] = $key;

if (is_array($value)) {
$fixed_files = $function($value, $fixed_files, $temp);
} else {
$next = array_splice($temp, 1, 1);
$temp = array_merge($temp, $next);

$new = &$fixed_files;

foreach ($temp as $key) {
$new = &$new[$key];
}

$new = $value;
}
}

return $fixed_files;
};

return $function($_FILES);
}


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
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.