+ 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

17th May 2022, 1:09 PM
HeeSo
HeeSo - avatar
1 Respuesta
+ 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
17th May 2022, 1:33 PM
Justice
Justice - avatar