Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 1:11am On Feb 27, 2016 |
seunthomas: A recursive function can actually terminate without an exit path a. scenerio out of memory (know this about java) b. stack overflow( saw this online) Aren't these errors? Is the correct way for a recursive function to work for it to run out of memory or have a stack overflow ? |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 1:08am On Feb 27, 2016 |
seunthomas: You own don dey finish be dat.lol. wetin u dey do for beer parlour for 1am. You dey carry gun join? I am interfacing with minds more intelligent than yours. By beer parlour I meant a Bar. I have never owned or held a gun |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 1:06am On Feb 27, 2016 |
asalimpo: is your trial-and-error approach allowed? running on a machine to check your work? I didn't know that trial and error was allowed. But I will indulge him |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 1:05am On Feb 27, 2016 |
seunthomas: Not in all cases. If i can think of a scenerio i will mention it later. I'm looking forward to a recursive function WITHOUT an exit path. Infinite loop aye |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 1:04am On Feb 27, 2016 |
seunthomas: I dont do that. I am here for the fun. Like i said earlier. What will it profit me to find out the women @dhtml18 has put in the family way?? LOL I'm actually at a beer parlour while I'm battling you. I've been here since 8pm. And no I'm not drunk. Very very sober |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 1:00am On Feb 27, 2016 |
seunthomas: Slay who? You wey no sabi wetin you put down, your question to guru01 was wrong( now am more convinced). My question to guru01 was sooooo correct. The question asked for which of the options wasn't true. Is it not true that you need an exit path if you want a recursive function to terminate? So how can B be a valid answer? |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:58am On Feb 27, 2016 |
seunthomas: You should. Considering what @dhtml did and you supported(trying to find out about me), i could really do some damage to you guys ohhh. I hope it does not get to mention of my past employee. Please dig. I am daring you to dig |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:57am On Feb 27, 2016 |
seunthomas: You don humble sha. LOL. Warehouse manager. Warehouse manager slaying a 16 yr programming veteran. I wonder what would be if I was a dedicated developer. I probably would have embalmed your remains and interred it long time ago |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:55am On Feb 27, 2016 |
seunthomas: @airsaylongcon The good thing about this challenge is am cracking my brain. lol
See you in the morning when my power is back. You will be in real trouble then I'm shivering |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:52am On Feb 27, 2016 |
seunthomas: typedef struct t { int i; int m; struct t *b, *d; }data; int count(data *a) { if (a->m){ return 0; } return count(a->b) + count(a->d)+1; }
No need am calling it a night. I need to look at it closely, right now i just fixed your typos. This runs but i have bus 10 error. C is a killer no garbage collection etc.
I dont want to crash my machine Take your time. I'm not in a rush. Just mention me when you are done |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:48am On Feb 27, 2016 |
seunthomas: You have so many mistakes in the code am correcting and checking with compiler. int count(struct t*a) { If (a->m) return 0; //WRONG If should be if return count(a->b) + count(a->d)+1; } Imagine the things you are nit picking. And you are test running on a compiler? Do you want me to retype the entire question again? |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:41am On Feb 27, 2016 |
seunthomas: A data structure is "built" using nodes. Each node has exactly two pointers that point to other nodes. None of the pointers is null. struct t { int i; int m; struct t *b, *d; };
Assumption 1: t->b is not null t->d is not null
A data structure is basically a kind of container to store data This problem is actually a tree(cant remember which type specifically).... Is this all? |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:30am On Feb 27, 2016 |
seunthomas: You quickly corrected your mistake na(boju boju as yoruba would say-cover up). Admit you set a wrong question and you get the answer but you may need to contact a c programmer to be sure. What i provide will actually run when compiled. Provide it lets see |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:24am On Feb 27, 2016 |
seunthomas: Seriously bro am disappointed you can descend low like this ohh
airsaylongcon:
Why you dey run mouth? How many hours e take you to ask me your own?. I will modify this post with the question so look out
*modified* A data structure is "built" using nodes. Each node has exactly two pointers that point to other nodes. None of the pointers is null. A C program is written to count how many nodes are accessible from any of the nodes in th data structure. The code use an "indicator" field (initialized to zero for all nodes). Correct the following code so that it works properly as it will not work in its current state
struct t (int i,m; struct t*b, *d) int count(struct t*a) { If (a->m) return 0; return count(a->b) + count(a->d)+1; }
Am not saying i wont solve it but you asked a question and you dont even know the answer so how do i know if am correct or wrong? Just common sense... Descend low how? What was it that I said that implied I descended low. I challenged you for a question at 6:57am and that question did not come until 10:08pm in the evening. Is that descending low? |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:20am On Feb 27, 2016 |
DanielTheGeek: Bro you are good. Shikena, please keep quiet! Let the real purpose of the thread be fulfilled. I am a rookie o. A mere warehouse rat. So please don't say I am good. As for the thread and it's purpose. Dhtml18 has killed the op so many times on this thread without a clap back from the OP. The op feels he can take on a rookie like me. Let him try |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:16am On Feb 27, 2016 |
seunthomas: Relax na. Since the guy did not even create a proper struct if i answer how can he mark it?? Can a teacher mark question that he does not know the answer? Let me retype that struct for you as you seem to have a problem that I collapsed it into one line Struct t { int i; int m; Struct t *b; Struct t *d; } |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:12am On Feb 27, 2016 |
FincoApps: Anytime I see this 1998 statement, I literally LAUGH OUT LOUD. It has been mentiond like 50 times on this thread but the OP only mistakenly said it once o  Someone who has been programming since that year is a veteran o! 16years in programming nobi beans |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:10am On Feb 27, 2016 |
seunthomas: Now look at your struct and see what you sent? Make comparison am waiting..... You asked for a struct with integers. I provided The struct I sent you involves pointers. You know what they are right? |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:05am On Feb 27, 2016 |
seunthomas: To be sure you know what you asked me to solve and not just checking answers in an online site, create a very simple struct with 2 integer members and a function; struct individual { int height; int weight; }; What do you want the function to do? |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 12:01am On Feb 27, 2016 |
asalimpo: @Seunthomas Take a deep breathe. Dont feel cornered. Read up on structs (you say you're no novice to c), to refresh your memory. I sense that the strange/ugly syntax (*,->,struct) is getting to you! Some one who has been programming since 1998 would have gone through basic,pascal, fortran, maybe COBOL before settling on Java php and python. Don't you think so? So a simple ugly looking C code should not intimidate him |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:58pm On Feb 26, 2016 |
seunthomas: To be sure you know what you asked me to solve and not just checking answers in an online site, create a very simple struct with 2 integer members and a function; My word! You really are a windbag. A chatter box. I did not ask you to prove your competence when you asked me to solve your challenge |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:56pm On Feb 26, 2016 |
dhtml18: And i still put it to you that you are completely wrong, yet you insist on your foolishness. Luckily, the repositories are for public consumption. The codes are visible to the WWW, let people decide for themselves. A thing is what it is - what you say does not matter.
You are too technically incompetent to decipher the difference between dhtmlsql and zebra_database, and that one is not my fault. I owe you no explanation because you are not smart enough to understand. If you think i have stolen the code, then report to the zebra_database dude, stop making mouth for nothing here. Don't let him use u as excuse to dodge my question. Let me crush this "programming since 1998" programmer |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:53pm On Feb 26, 2016 |
seunthomas: So you want to ask me a question you cant solve? Really!!!!! The rules for the challenge was that you should also be able to solve it na... I can and I have solved it. Now get to work as time is running. Remember I'm a lowly warehouse rat and you are the big dog well experienced programmer |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:49pm On Feb 26, 2016 |
seunthomas: Now you are making me laugh sha. Do you even know c at all?? Or this is just to wind seunthomas up... I gave you a solution to guru01 code in C and you picked it apart highlighting security errors. That's why I chose a C code for you. To exhibit your skills |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:46pm On Feb 26, 2016 |
seunthomas: I will do it in c but
Correct the following code so that it works properly as it will not work in its current state? Means its broken A C program is written to count how many nodes are accessible from any of the nodes in th data structure
I assume you want this to be corrected int count(struct t*a) { If (a->m) return 0; return count(a->b) + count(a->d)+1; }
and not the struct itself. Correct wherever you feel a correction is required |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:44pm On Feb 26, 2016 |
seunthomas: First of all the question does not look like its properly presented. I can make assumptions sha... What issues have you got with it? Unlike you, I am willing to explain. You insulted me that we aren't on the same level of understanding when I asked u to further explain your question. But I am willing to explain mine |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:38pm On Feb 26, 2016 |
FincoApps: They are really strong questions..... reminds me of Ms certification exams There are some more brutal ones on programming language grammars. Static and dynamic variable scoping. Flip flops and several other really bloody ones |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:36pm On Feb 26, 2016 |
seunthomas: See your life can you solve it? Why ask me what you cant solve and how do i know your answer is correct cos it would seem unfair. We will work through it together. The clue to the solution is right before you |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:34pm On Feb 26, 2016 |
seunthomas: First of all, do you know the answer to the question you asked me(Seriously and no fooling around).
The challenge was supposed to be generic with a choice to pick a any tool of choice. I know c but i prefer to use python or java for this kind of task.
Lastly was this question sourced online because the idea was to test individual skills and not to throw me interview questions from online sources( i may still attempt it but require honesty on that). Do I know the answer? Yes Why did I streamline to C? Because you picked my C code apart with security issues. I want you to identify the problem with this one Was it sourced online? You be the judge of that. Google is your friend |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:31pm On Feb 26, 2016 |
FincoApps: Are you getting this questions from past certification exams ? From a question bank used by a multinational software company in recruiting trainee developers |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:25pm On Feb 26, 2016 |
seunthomas: I no fit answer this one tonight ohhh as i don tire na. But i will ask some questions first before going into a solution. You will ask questions?!  I did not ask any one question when you fired your question. Abi u wan Google am? Be my guest. What time tomorrow should I expect your answer tomorrow? |
Programming › Re: The Greatest Programmer On Nairaland by airsaylongcon: 11:20pm On Feb 26, 2016 |
airsaylongcon: A data structure is "built" using nodes. Each node has exactly two pointers that point to other nodes. None of the pointers is null. A C program is written to count how many nodes are accessible from any of the nodes in th data structure. The code uses an "indicator" field (initialized to zero for all nodes). Correct the following code so that it works properly as it will not work in its current state
struct t (int i,m; struct t *b, *d) int count(struct t *a) { If (a->m) return 0; return count(a->b) + count(a->d)+1; }
Ps: m is the "indicator" field Seunthomas come chop |