Stats: 3,243,097 members, 8,123,474 topics. Date: Thursday, 03 April 2025 at 06:36 AM |
Nairaland Forum / LogicDcoder's Profile / LogicDcoder's Posts
(1) (2) (3) (4) (5) (6) (of 6 pages)
![]() |
Grandlord: You don't need to know any of this when solving this kind of problem here in nairaland. CP sites like Topcoder, CodeSignal , Hackerrank etc requires the knowledge of time complexity. Bro just study each problem and try and solve 'em.(Here you don't have any time or memory limit). I got it from CodeSignal 1 Like |
![]() |
tensazangetsu20: Where you dey go?... Relax and learn 2 Likes |
![]() |
Problem 1 Solution: PL used: Java The approach was quite easy. Pseudo Code [1] Iterate the array and multiply the adjacent elements and then compare the product with the variable containing the max product. [2]If the product of the adjacent element is greater than that of the variable containing the max product then assign the value of the product of the adjacent element to the variable containing the max product. 1 Like
|
![]() |
WEEK 1: Well will start from the easy ones: 1 Like
|
![]() |
Good Morning NL! This thread is meant for programmers [noob] that want to sharpen their problem solving skills using any programming language. The OP of the thread will be posting two/three algorithmic problems here every week. READ ME: Anybody can contribute his/her own solution but make sure to provide the pseudo code. You can use any programming language of your choice. To submit your solution screenshot your IDE and post the resulting image here(A well commented code don't need a pseudo code). Scroll Down To See Week 2 Questions. Thread Official Languages: English/Pidgin English NB: Try and solve the problems first before consulting Mr Stackoverflow. Ogah Seun, Mukina2 and lalasticlala let's give this thread a chance *smiles* Thanks Okeke Enoch Chibuzo 2 Likes |
![]() |
Programmers make use of a branch of mathematics known as discrete math. You don't have to be guru at math to learn how to program. It also depends on the level you're operating on. |
![]() |
let's go! +2349033629167 |
![]() |
wow |
![]() |
parkervero: Thanks |
![]() |
Using vpn in some countries like north Korea(You don't even have access to foreign OS), China and Russia is illegal. But it's only illegal when you use it to access illegal/restricted websites. |
![]() |
Good Morning Guys. Multithreading is one the most complicated topics that I have ever faced in java (esp. synchronization methods and interthread communication). I understood all the theoretical concepts but my problem is implementation. Can someone also explain Producer-Consumer Problem using threads? ps: You can refer me to any pdfs, Youtube video or web pages.
|
![]() |
Hey people. I hope you are having a fantastic day. Lately I have been having loads of fun with esolang related things. I decided to share some of the weirdest and coolest programming languages I have used. ArnoldC - programming language based on the one-liners of Arnold Schwarzenegger. AsciiDots - a programming language based entirely on ascii art. Cheese++ - a programming language based almost entirely on the operational working principles of cheese. Chef - a stack-based language where programs look like cooking recipes. Cow - programming language was designed with the bovine in mind. Emojicode - a open-source, full-blown programming language consisting of emojis. FALSE - a programming language built to confuse everyone with an obfuscated syntax. Folders - a language where the code is written with folders. LOLCODE - a programming language inspired by lolspeak, the language expressed in examples of the lolcat Internet meme. Malbolge - a programming language named after the eighth circle of hell in Dante's Inferno, the Malebolge, designed to be impossible to use. Ook! - a programming language designed for orangutans. reMorse - a programming language made to look like Morse code. Rockstar - a programming language designed for creating programs that are song lyrics. Omgrofl - a programming language where all commands are made up of internet acronyms, such as lol, wtf, brb, stfu, and more. Shakespeare - A programming language created with the design goal to make the source code resemble Shakespeare plays. Thue - a language of symbols. TrumpScript - make python great again. Whitespace - A programming language composed entirely of whitespace. You can find a hello world example for all of these languages in this github https://github.com/gadhagod/Wierd-Languages repository. If you want a language added to the list, comment or open a pull request! Thanks for reading. Definitely try out some of these. |
![]() |
[img]https://img./hsi/aHR0cHM6Ly9kYWlseXBvc3Qubmcvd3AtY29udGVudC91cGxvYWRzLzIwMjEvMDEvdGVyc3RlZ2VuLWxlb21lc3NpLmpwZWc=/images/terstegen-leomessi.jpeg[/img] Barcelona king, Lionel Messi, has reportedly clashed with goalkeeper, Marc-Andre ter Stegen as the crisis in the club's dressing room reaches a boiling point, according to Diaro Gol. This is not the first time Messi and the German shot-stopper have fallen out at Barcelona as they have had issues in the past as well. According to the newspaper, the Argentine superstar and the goalkeeper have had a massive bust-up that has seen their relationship falling out completely. The Spanish newspaper said that the reason for their fight is because Messi had opted for Keylor Navas as his first choice during the voting for the FIFA The Best awards. Messi went on to choose Bayern Munich's Manuel Neuer and Atletico Madrid's Jan Oblak as his second and third choices. This was rather seen as quite a shocking choice of votes from the South American superstar who generally always voted for his teammates. And his decision of snubbing Marc-Andre ter has not gone down well with the goalkeeper. Diaro Gol reports that Ter Stegen has even reconsidered his future at the club despite renewing his contract with the club recently. Ter Stegen has now reportedly put a hold on his autobiography movie, with the reason being that he wants his movie to be made next season when Messi is expected to leave Camp Nou. It is certain that Messi will leave the club next summer, however, as of now, there seems to be no offer. |
![]() |
Godx: Very soon him go live barca go else where make i see who una go blam 1 Like |
![]() |
Those guys are po*n actors. They wan use am minimize expenditure. Better drugs wey dey expensive full there why qumdoms n viagra.
|
![]() |
Make I reserve my comment 1 Like
|
![]() |
C-lang |
![]() |
Karleb:For now LL and Q |
![]() |
Karleb:But that's the real programming! |
![]() |
cixak95211:Hmmmm |
![]() |
salvationproject:okay |
![]() |
Please mods we really need a section in nairaland dedicated for DSA. What Do You Guys Think? DSA is very important in the life of every programmer and we need a section here where programmers can meet up and solve DSA problems. 1 Like
|
![]() |
Guys I need someone who will explain what time complexity(Linear time, quadratic time, logarithmic time etc.). It has been holding me back since. Learning data structures and its implementations + Algorithms are very easy. |
![]() |
Your code would be cleaner if you break common operations there into classes and methods. |
![]() |
parkervero:IDE reports common syntax errors but not all ooo |
![]() |
cixak95211: I don't know how to use debuggers |
![]() |
TheHulk616: Hmmm You're right |
![]() |
Mine is that I normally forget to terminate some statements (I use syntactically written languages(Java, C++ etc.) not dynamically written ones(Python, kotlin etc.)) and also if I want to compile a program using PowerShell I often use backward slashes instead of forward slashes while inputting the program's directory. The latter made me debug a bugless code for over one hour *laughs* trying to find something that's not there. I later found out that I used backward slashes (Even though I was facially happy but deep inside I was filled with anger). Share Yours! 1 Like
|
![]() |
TheHulk616: LOL! Messi is not Overrated bro... It's just that this season no favor am. The guy is really good. |
![]() |
Real Madrid need to sign Lord Messi at the Moment. #HalaMadrid 3 Likes |
![]() |
M E S S I - G O A T Whether Messi is playing or not! 8 Likes |
![]() |
Etinosa1234:cc peacettw Bro global variables have different meanings, it depends on language that you're using. how that language defines it determines its characteristics. for example a global variable in C language is different from that in java(Technically java doesn't support global variable). lemme use C to describe it first. A global variable in C is a variable declared outside the main function/subroutine /method or other functions. The variable is static in nature this means that it can be accessed by any part of the program(that is other .c files created for that particular project) and it's independent of any block. But a local variable is a variable declared inside a block only the code inside the block have access to this variable. It can't be accessed by codes outside the block. The life time of the variables is one of factors that differentiate the two variable; the life time of global variables end when the program execution end while the life time of a local variable ends when the program control exits the block it is defined in. C Code snippet inside main.c file: #include <stdio.h> #include <stdlib.h> //this is a global variable int myvar; int main(){ int myvar2;//a local variable since it's in the main block and not modified by static. static int myvar3;//Another global variable. //myvar can be accessed here. } Now in java people often say that global variable is declared using the the modifier public. Now let me ask you what about the modifier static. Like I said initially that global variable is independent of any block but in the simple program you wrote the variable depends on the class block which makes the instance variable a local one. Java doesn't support global variable since using public to define a variable in a class will only make that variable accessible through the object of the class the variable is defined in. Mind you that what you declared in that MyClass Class is an instance variable. In java to achieve something that is similar to a global variable but not a GV o! Declare a variable using public static modifier. Look at this code snippet: class MyClass{ public static int myvar; //Accesing myvar3 Main.myvar3 = 3; //myvar2 is invisible here. } class Main{ public static void main(Strng[] args){ int myvar2; static myvar3; //myvar is visible here MyClass.myvar=10; } } The code snippet above has shown you the actual thing these modifiers do. Notice that I initialized myvar in Main class using MyClass.myvar. The static modifier made this variable to act like a global variable. The static made the variable independent of the object of MyClass, that's we can access it from the class directly without creating an object of MyClass. So as myvar3 which we accessed in MyClass using Main.myvar3. Also notice that I didn't put public there because all the variable declared inside a class is a public modified variable as far as it's not modified with "private". These might be confusing but with constant practicing you will scale through. 1 Like |
(1) (2) (3) (4) (5) (6) (of 6 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 - 2025 Oluwaseun Osewa. All rights reserved. See How To Advertise. 50 |