+ 1
Pseudo code to c code
I had this questions in my homework he need us to write a pseucode, Two linear list La and Lb are used to represent two datasets A and B respectively. Now we want to get a new set A = A and B. void union(List &LaïŒList Lb) { La-len=listlength(La); Lb-len=listlength(Lb); //get the length of list for(i=1; i<=Lb-len; i++) { //get the ith element from Lb and assign the value to eâ Getelem(LbïŒiïŒe); //insert e if there is no the same element in La if(!locateelem(LaïŒeïŒequal)) { listinsert(LaïŒ++La-lenïŒe); } } } This is my answer, is it correct ? And if so how can I write it in c code ? Any help will be appreciated
1 Answer
+ 1
Hello! I believe you're relying way too much on syntax. It looks like a regular piece of code with a couple of comments.
With pseudocode, you don't really solve the issue already, but moreso write instructions on how to solve the problem.
I recommend checking out this video that explains writing pseudocode:
https://youtu.be/PwGA4Lm8zuE