₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,327,294 members, 8,430,245 topics. Date: Saturday, 20 June 2026 at 07:42 AM

Toggle theme

Please I Need More Proficient Alternatives C/C++ Coders! - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingPlease I Need More Proficient Alternatives C/C++ Coders! (672 Views)

1 Reply (Go Down)

Please I Need More Proficient Alternatives C/C++ Coders! by logicDcoder(op): 8:30pm On Aug 10, 2020
The code below is an implementation of Linked List using C language. I converted a string of characters to a Linked List. So I need you guys to give me a better alternative here(Check each routine/function and make your changes).

Re: Please I Need More Proficient Alternatives C/C++ Coders! by tensazangetsu20(m): 9:35pm On Aug 10, 2020
Check codingschool's youtube channel. Dude is amazing at teaching data structures and algorithms.
Re: Please I Need More Proficient Alternatives C/C++ Coders! by logicDcoder(op): 10:02pm On Aug 10, 2020
tensazangetsu20:
Check codingschool's youtube channel. Dude is amazing at teaching data structures and algorithms.
Alright thanks
Re: Please I Need More Proficient Alternatives C/C++ Coders! by Nobody: 7:17am On Aug 11, 2020
Get rid of that LINK typedef. Use less of macros/typedefs in the future cause they actually confuse people sometimes, it's stressful going back to check a macro/typedef every single time. You used string as a typedef then used it as a variable in a function. Stop using recursion it is bloodily slow and eats space on the stack (a space for function variables and instruction pointer values for switching between functions) and is prone to segmentation faults, use loops especially for the count function.
Re: Please I Need More Proficient Alternatives C/C++ Coders! by stanliwise(m): 9:54am On Aug 11, 2020
SegFault:
Get rid of that LINK typedef. Use less of macros/typedefs in the future cause they actually confuse people sometimes, it's stressful going back to check a macro/typedef every single time. You used string as a typedef then used it as a variable in a function. Stop using recursion it is bloodily slow and eats space on the stack (a space for function variables and instruction pointer values for switching between functions) and is prone to segmentation faults, use loops especially for the count function.
But recursion somewhat remains the elegant way to traverse a linked list.
Although while loop is cool sha
Re: Please I Need More Proficient Alternatives C/C++ Coders! by Nobody: 2:21pm On Aug 11, 2020
stanliwise:
But recursion somewhat remains the elegant way to traverse a linked list.
Although while loop is cool sha
It is but it eats up stack memory which has a limit and can not be increased by the operating system, once it hits that limit you get a stack overflow exception on Linux a signal on windows I don't know an exception I think. And it is slower than looping, the low level instructions that are executed before calling a function swells it up a bit. I don't use recursion except when the problem looks a little tougher and recursion seems like the only way.
Re: Please I Need More Proficient Alternatives C/C++ Coders! by stanliwise(m): 3:04pm On Aug 11, 2020
SegFault:
It is but it eats up stack memory which has a limit and can not be increased by the operating system, once it hits that limit you get a stack overflow exception on Linux a signal on windows I don't know an exception I think. And it is slower than looping, the low level instructions that are executed before calling a function swells it up a bit. I don't use recursion except when the problem looks a little tougher and recursion seems like the only way.
Very true but some compiler support recursion optimization, so one can can use an implementation called tail recursion.
Re: Please I Need More Proficient Alternatives C/C++ Coders! by OGWILLS123: 3:12pm On Aug 11, 2020
Good day guys.

I hardly heard of video editor's on nairaland is it that we don't have any ?.
Please i wanted to ask some question, because am about picking a career in that section.
And this �� are my question.
How long will it takes me to complete the training?
How frequently can i I get a job ?
Can i work as a freelancer with the skill ?
Is it hard to find a job ?
And finally can i make a living with the skill.

You can also share your experience as one.


[left][/left]Thanks
Re: Please I Need More Proficient Alternatives C/C++ Coders! by Nobody: 3:27pm On Aug 11, 2020
stanliwise:
Very true but some compiler support recursion optimization, so one can can use an implementation called tail recursion.
Yah but that stack issue is still a problem. And worst of all sometimes compiler optimisation makes debugging a hell of a problem. Sha anyhow I think people should use it in cases where the an implementation with loops might not be easy and where data is small too, for example parsing tokens.
Re: Please I Need More Proficient Alternatives C/C++ Coders! by logicDcoder(op):
SegFault:
Get rid of that LINK typedef. Use less of macros/typedefs in the future cause they actually confuse people sometimes, it's stressful going back to check a macro/typedef every single time. You used string as a typedef then used it as a variable in a function. Stop using recursion it is bloodily slow and eats space on the stack (a space for function variables and instruction pointer values for switching between functions) and is prone to segmentation faults, use loops especially for the count function.
Noted boss! but i really love using typedef because it makes me type less. If using for or while loop is better, could you write a function that concatenates two linked lists?
Re: Please I Need More Proficient Alternatives C/C++ Coders! by Deicide: 8:08am On Aug 13, 2020
The only advantage recursion have over iteration mainly on trees is back tracking.....so sometimes you might have no other option that using it.
1 Reply

Coders, How Long Do Your Laptop Batteries Last?Vacancies For Programmers, Coders And DevelopersAIDE-IDE For Java And C/C++ And AIDE for Web Worth It ?234

Meet Godot: The Powerful Game Engine That Python Programmers Will LoveWhat you must consider before becoming a Data ScientistHelp A Novice