[removed]DevelopingTechnical Software As.docx

[removed] Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 1 COS10007 - Developing Technical Software Assignment (4 x 6.25= 25 Marks) Submission Requirements 1. No zip files, no multiple files 2. Submit only one file 3. Copy and paste your codes into one word document 4. Copy and paste the screen shot of the output window in the same word document 5. Use only .doc, .docx extensions – no other format will be accepted for marking You may be asked to demonstrate/explain your work to the tutor, if you are absent/unavailable or fail to demonstrate properly, zero marks will be awarded. Please note, this is an individual task and it will be checked for plagiarism. Both parties will be penalised if any plagiarism found. Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 2 Qn 1. Creating Linked List in C Create a linked list using the following structure struct studentid { int id; struct studentid *next; }; typedef struct studentid STUDENTid; typedef STUDENTid *STUDENTidPtr; You have to create a linked list manually similar to week 4 Qn1 lab exercise. The re should be five nodes in the linked list and the elements should be the last 5 digits of your student id . One d igit will go to one node and the node insertion should happen in order similar to week 4 Qn 1 . Eg: Assume your student id is 100989674, take the last five digits which is 89674 so the insertion order is newptr= ... ... ..malloc( STUDENTid ); newptr - >id=8; . . . 9 . . 6 . 7 . . 4 and the final linked list should b e 4 6 7 9 8 NULL Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 3 Qn2. Write the following functions in C program, assuming the node type used is as follows: struct node { int data; struct node* next; }; and head is the head pointer of a list: struct node* head; a) Write a sortedMerge() function in C program that taking two lists, each of which is sorted in increasing order, and merges the two together into one list which is increasing order. This function should return a new list, which should be intertwining the nodes of the first two lists. You should consider various cases, e.g. i. either 'a' or 'b' may be empty, ii. during processing either 'a' or 'b' may run out first You should use the following function header: struct node* sortedMerge(struct node* a, struct node* b) { /* Your code... */ b) Write another function named removeRedundant() which takes a list sorted in increasing order and deletes any duplicate nodes from the list. Ideally, the list should only be traversed once. /* Remove duplicates from a sorted list. */ void removeRedundant(struct node* head) { // Your code... Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 4 Qn3. Write a complete C++ program to compute the value of a g.

[removed]
Developing
Technical Software Assignment
TP3 2016
© S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y
Page
1
COS10007
-
Developing Technical Software
Assignment
(4 x 6.25= 25 Marks)
Submission Requirements
1. No zip files, no multiple files
2. Submit only one file
3. Copy and paste your codes into
one word document
4. Copy and paste the screen shot of the output window in the
same
word document
5. Use only .doc, .docx extensions
–
no other format will be
accepted for marking
You may be asked to demonstrate/explain your work to the
tutor, if you are absent/unavailable or fail to demonstrate
properly, zero marks will be awarded.
Please note, this is an individual task and it will be checked for
plagiarism. Both parties will be
penalised if any plagiarism
found.
Developing
Technical Software Assignment
TP3 2016
© S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y
Page
2
Qn 1. Creating Linked List in C
Create a linked list using the following structure
struct studentid {
int id;
struct studentid *next;
};
typedef
struct
studentid STUDENTid;
typedef
STUDENTid *STUDENTidPtr;
You have to create a linked list manually similar to week 4 Qn1
lab
exercise. The
re should be five nodes in the linked list and the
elements
should be the last 5 digits of your student id
.
One
d
igit
will
go to one node and the node insertion should happen
in order
similar to week 4 Qn 1
.
Eg: Assume your student id is 100989674, take the last five
digits
which is 89674 so the insertion order is
newptr=
...
...
..malloc(
STUDENTid
);
newptr
-
>id=8;
.
.
.
9
.
.
6
.
7
.
.
4
and the final linked list should b
e
4
6
7
9
8
NULL
Developing
Technical Software Assignment
TP3 2016
© S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y
Page
3
Qn2.
Write the following functions in C program, assuming the node
type used is as follows:
struct node {
int data;
struct node* next;
};
and head is the head pointer of a list:
struct node* head;
a)
Write a
sortedMerge()
function in C program that taking two lists,
each of which is sorted in increasing order, and merges the two
together into one list which is increasing order. This function
should return a new list, which should be intertwining
the nodes
of the first
two
lists. You should consider various cases, e.g.
i.
either 'a' or 'b' may be empty,
ii.
during processing either 'a' or 'b' may run out first
You should use the following function header:
struct node* sortedMerge(struct node* a, struct
node* b)
{
/* Your code... */
b) Write another function named removeRedundant() which
takes a
list sorted in increasing order and deletes any duplicate nodes
from
the list. Ideally, the list should only be traversed once.
/* Remove duplicates from a sorted list. */
void removeRedundant(struct node* head) {
// Your code...
Developing
Technical Software Assignment
TP3 2016
© S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y
Page
4
Qn3.
Write a complete C++ program to compute the value of a
given position in Pascal's Triangle. To compute the value at any
give
n position, just add up the numbers to the position's right and
left in
the previous row (see picture below).
For example, to get the middle number in the 5th row, add 3 and
3
(from the 4th row). The sides of the triangle are always 1, as it
only
add t
he number of the upper left or the upper right, where there is
no second number on the other side.
Your program should prompt the user to input a row and a
position
in
the row.
The program should ensure
that the input is valid before
computing a value for
the position. Then your
trianglePascal()
function will take this two parameters for calculation.
Developing
Technical Software Assignment
TP3 2016
© S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y
Page
5
Q4.
Write a complete C program, that Uses a one
-
dimension array
to read 20 numbers, each of them is between 0 and 100,
inclusive.
a.
Uses a selectionSort() function to sort the array in ascending
order. Discuss the Big O of your sorting algorithm for the
best case
and worst case scenarios.
b.
Write another function that improve the performance of your
program by using another sorting algorithm (any algorithm
learned
in the lecture), discuss the Big O of the new algorithm used.

Recomendados

Mmt 001 von
Mmt 001Mmt 001
Mmt 001sujatam8
506 views6 Folien
Cse cpl manual-2016 von
Cse cpl manual-2016Cse cpl manual-2016
Cse cpl manual-2016Rajendra khatana
376 views124 Folien
Cp manual final von
Cp manual finalCp manual final
Cp manual finalitprasad1237
476 views71 Folien
A01 von
A01A01
A01lksoo
368 views5 Folien
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY von
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYANJALAI AMMAL MAHALINGAM ENGINEERING COLLEGE
4.9K views75 Folien
Important C program of Balagurusamy Book von
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy BookAbir Hossain
1.8K views11 Folien

Más contenido relacionado

Similar a [removed]DevelopingTechnical Software As.docx

C# programming (3rd semester) von
C# programming (3rd semester)C# programming (3rd semester)
C# programming (3rd semester)Ketan Rajpal
218 views70 Folien
Lab6: I/O and Arrays von
Lab6: I/O and ArraysLab6: I/O and Arrays
Lab6: I/O and Arraysenidcruz
343 views3 Folien
educational course/tutorialoutlet.com von
educational course/tutorialoutlet.comeducational course/tutorialoutlet.com
educational course/tutorialoutlet.comjorge0043
269 views125 Folien
Assignment 2 von
Assignment 2Assignment 2
Assignment 2usman mehmood
14 views1 Folie
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx von
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxBTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxAASTHA76
2 views22 Folien
Write a c++ program(Sum the major diagonal in a matrix) Write a f.pdf von
Write a c++ program(Sum the major diagonal in a matrix) Write a f.pdfWrite a c++ program(Sum the major diagonal in a matrix) Write a f.pdf
Write a c++ program(Sum the major diagonal in a matrix) Write a f.pdfcronkwurphyb44502
5 views2 Folien

Similar a [removed]DevelopingTechnical Software As.docx(20)

C# programming (3rd semester) von Ketan Rajpal
C# programming (3rd semester)C# programming (3rd semester)
C# programming (3rd semester)
Ketan Rajpal218 views
Lab6: I/O and Arrays von enidcruz
Lab6: I/O and ArraysLab6: I/O and Arrays
Lab6: I/O and Arrays
enidcruz343 views
educational course/tutorialoutlet.com von jorge0043
educational course/tutorialoutlet.comeducational course/tutorialoutlet.com
educational course/tutorialoutlet.com
jorge0043269 views
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx von AASTHA76
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxBTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
AASTHA762 views
Write a c++ program(Sum the major diagonal in a matrix) Write a f.pdf von cronkwurphyb44502
Write a c++ program(Sum the major diagonal in a matrix) Write a f.pdfWrite a c++ program(Sum the major diagonal in a matrix) Write a f.pdf
Write a c++ program(Sum the major diagonal in a matrix) Write a f.pdf
How to make the implementation file (matrix-cpp) for this assignment-.pdf von ColinjHJParsonsa
How to make the implementation file (matrix-cpp) for this assignment-.pdfHow to make the implementation file (matrix-cpp) for this assignment-.pdf
How to make the implementation file (matrix-cpp) for this assignment-.pdf
Oop lab assignment 01 von Drjilesh
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
Drjilesh41 views
Java conceptual learning material von ArthyR3
Java conceptual learning materialJava conceptual learning material
Java conceptual learning material
ArthyR3284 views
Project 1 – EECS 2110Assembly Language Programming.Due.docx von briancrawford30935
Project 1 – EECS 2110Assembly Language Programming.Due.docxProject 1 – EECS 2110Assembly Language Programming.Due.docx
Project 1 – EECS 2110Assembly Language Programming.Due.docx
Total Grade (45 pts)COSC 1436 Lab 4 AssignmentName (First .docx von edwardmarivel
Total Grade (45 pts)COSC 1436  Lab 4 AssignmentName (First  .docxTotal Grade (45 pts)COSC 1436  Lab 4 AssignmentName (First  .docx
Total Grade (45 pts)COSC 1436 Lab 4 AssignmentName (First .docx
edwardmarivel3 views
EN3085 Assessed Coursework 1 1. Create a class Complex .docx von gidmanmary
EN3085 Assessed Coursework 1  1. Create a class Complex .docxEN3085 Assessed Coursework 1  1. Create a class Complex .docx
EN3085 Assessed Coursework 1 1. Create a class Complex .docx
gidmanmary3 views
EN3085 Assessed Coursework 1 1. Create a class Complex .docx von christinemaritza
EN3085 Assessed Coursework 1  1. Create a class Complex .docxEN3085 Assessed Coursework 1  1. Create a class Complex .docx
EN3085 Assessed Coursework 1 1. Create a class Complex .docx
Name _______________________________ Class time __________.docx von rosemarybdodson23141
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
CSCI1250 Project 3 Fall 2015 CSCI1250 INTRODUCTIO.docx von faithxdunce63732
CSCI1250    Project 3  Fall 2015  CSCI1250 INTRODUCTIO.docxCSCI1250    Project 3  Fall 2015  CSCI1250 INTRODUCTIO.docx
CSCI1250 Project 3 Fall 2015 CSCI1250 INTRODUCTIO.docx
c++ Question von Hamza4467
c++  Questionc++  Question
c++ Question
Hamza4467224 views
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 von manjurkts
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
manjurkts911 views

Más de lanagore871

·Think about your motivations for becoming a clinical mental hea.docx von
·Think about your motivations for becoming a clinical mental hea.docx·Think about your motivations for becoming a clinical mental hea.docx
·Think about your motivations for becoming a clinical mental hea.docxlanagore871
31 views1 Folie
·The health communication plan should be expounded upon to resul.docx von
·The health communication plan should be expounded upon to resul.docx·The health communication plan should be expounded upon to resul.docx
·The health communication plan should be expounded upon to resul.docxlanagore871
10 views1 Folie
·This assignment helps you develop the skills to master the foll.docx von
·This assignment helps you develop the skills to master the foll.docx·This assignment helps you develop the skills to master the foll.docx
·This assignment helps you develop the skills to master the foll.docxlanagore871
5 views4 Folien
·Step 10 Case Three Big Brain Solutions—Arbitration or Litigat.docx von
·Step 10 Case Three Big Brain Solutions—Arbitration or Litigat.docx·Step 10 Case Three Big Brain Solutions—Arbitration or Litigat.docx
·Step 10 Case Three Big Brain Solutions—Arbitration or Litigat.docxlanagore871
3 views1 Folie
·There are several advantages and challenges of using a client .docx von
·There are several advantages and challenges of using a client .docx·There are several advantages and challenges of using a client .docx
·There are several advantages and challenges of using a client .docxlanagore871
2 views1 Folie
·Review this week’s Learning Resources, and consider the criteri.docx von
·Review this week’s Learning Resources, and consider the criteri.docx·Review this week’s Learning Resources, and consider the criteri.docx
·Review this week’s Learning Resources, and consider the criteri.docxlanagore871
3 views1 Folie

Más de lanagore871(20)

·Think about your motivations for becoming a clinical mental hea.docx von lanagore871
·Think about your motivations for becoming a clinical mental hea.docx·Think about your motivations for becoming a clinical mental hea.docx
·Think about your motivations for becoming a clinical mental hea.docx
lanagore87131 views
·The health communication plan should be expounded upon to resul.docx von lanagore871
·The health communication plan should be expounded upon to resul.docx·The health communication plan should be expounded upon to resul.docx
·The health communication plan should be expounded upon to resul.docx
lanagore87110 views
·This assignment helps you develop the skills to master the foll.docx von lanagore871
·This assignment helps you develop the skills to master the foll.docx·This assignment helps you develop the skills to master the foll.docx
·This assignment helps you develop the skills to master the foll.docx
lanagore8715 views
·Step 10 Case Three Big Brain Solutions—Arbitration or Litigat.docx von lanagore871
·Step 10 Case Three Big Brain Solutions—Arbitration or Litigat.docx·Step 10 Case Three Big Brain Solutions—Arbitration or Litigat.docx
·Step 10 Case Three Big Brain Solutions—Arbitration or Litigat.docx
lanagore8713 views
·There are several advantages and challenges of using a client .docx von lanagore871
·There are several advantages and challenges of using a client .docx·There are several advantages and challenges of using a client .docx
·There are several advantages and challenges of using a client .docx
lanagore8712 views
·Review this week’s Learning Resources, and consider the criteri.docx von lanagore871
·Review this week’s Learning Resources, and consider the criteri.docx·Review this week’s Learning Resources, and consider the criteri.docx
·Review this week’s Learning Resources, and consider the criteri.docx
lanagore8713 views
·Select one of these two cases for your individual case stud.docx von lanagore871
·Select one of these two cases for your individual case stud.docx·Select one of these two cases for your individual case stud.docx
·Select one of these two cases for your individual case stud.docx
lanagore8712 views
·Multiple Intelligence Self AssessmentThis week were goin.docx von lanagore871
·Multiple Intelligence Self AssessmentThis week were goin.docx·Multiple Intelligence Self AssessmentThis week were goin.docx
·Multiple Intelligence Self AssessmentThis week were goin.docx
lanagore8713 views
·Review a guide to writing cover letters, located at httpso.docx von lanagore871
·Review a guide to writing cover letters, located at httpso.docx·Review a guide to writing cover letters, located at httpso.docx
·Review a guide to writing cover letters, located at httpso.docx
lanagore8712 views
·Response GuidelinesReply to the posts of two peers in thi.docx von lanagore871
·Response GuidelinesReply to the posts of two peers in thi.docx·Response GuidelinesReply to the posts of two peers in thi.docx
·Response GuidelinesReply to the posts of two peers in thi.docx
lanagore8715 views
·Identify the pathophysiological mechanisms of inflammatory bowe.docx von lanagore871
·Identify the pathophysiological mechanisms of inflammatory bowe.docx·Identify the pathophysiological mechanisms of inflammatory bowe.docx
·Identify the pathophysiological mechanisms of inflammatory bowe.docx
lanagore8713 views
·Internet ActivityONet Resource CenteroVisit the Depart.docx von lanagore871
·Internet ActivityONet Resource CenteroVisit the Depart.docx·Internet ActivityONet Resource CenteroVisit the Depart.docx
·Internet ActivityONet Resource CenteroVisit the Depart.docx
lanagore8712 views
·Peer-Reviewed and Scholarly SourcesIn our readings this week,.docx von lanagore871
·Peer-Reviewed and Scholarly SourcesIn our readings this week,.docx·Peer-Reviewed and Scholarly SourcesIn our readings this week,.docx
·Peer-Reviewed and Scholarly SourcesIn our readings this week,.docx
lanagore8712 views
·Paper should be on a topic in chemistry that you would like to .docx von lanagore871
·Paper should be on a topic in chemistry that you would like to .docx·Paper should be on a topic in chemistry that you would like to .docx
·Paper should be on a topic in chemistry that you would like to .docx
lanagore8712 views
·From the e-Activity, analyze the basis for classifying courts i.docx von lanagore871
·From the e-Activity, analyze the basis for classifying courts i.docx·From the e-Activity, analyze the basis for classifying courts i.docx
·From the e-Activity, analyze the basis for classifying courts i.docx
lanagore8712 views
·No less than two pages causal argument research plan·.docx von lanagore871
·No less than two pages causal argument research plan·.docx·No less than two pages causal argument research plan·.docx
·No less than two pages causal argument research plan·.docx
lanagore8712 views
·Internet ActivityU.S. Office of Personnel ManagementVisit.docx von lanagore871
·Internet ActivityU.S. Office of Personnel ManagementVisit.docx·Internet ActivityU.S. Office of Personnel ManagementVisit.docx
·Internet ActivityU.S. Office of Personnel ManagementVisit.docx
lanagore8713 views
·Elaborate your own definition of production operations mana.docx von lanagore871
·Elaborate your own definition of production operations mana.docx·Elaborate your own definition of production operations mana.docx
·Elaborate your own definition of production operations mana.docx
lanagore8712 views
·Dewhat is COPD diagnosis, how to treat it, and prevention it fr.docx von lanagore871
·Dewhat is COPD diagnosis, how to treat it, and prevention it fr.docx·Dewhat is COPD diagnosis, how to treat it, and prevention it fr.docx
·Dewhat is COPD diagnosis, how to treat it, and prevention it fr.docx
lanagore8716 views
·Discussion 2 Bereavement and Client Diagnosis·Although g.docx von lanagore871
·Discussion 2 Bereavement and Client Diagnosis·Although g.docx·Discussion 2 Bereavement and Client Diagnosis·Although g.docx
·Discussion 2 Bereavement and Client Diagnosis·Although g.docx
lanagore8713 views

Último

Computer Introduction-Lecture06 von
Computer Introduction-Lecture06Computer Introduction-Lecture06
Computer Introduction-Lecture06Dr. Mazin Mohamed alkathiri
89 views12 Folien
Structure and Functions of Cell.pdf von
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdfNithya Murugan
545 views10 Folien
Solar System and Galaxies.pptx von
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptxDrHafizKosar
91 views26 Folien
GSoC 2024 von
GSoC 2024GSoC 2024
GSoC 2024DeveloperStudentClub10
79 views15 Folien
MercerJesse2.1Doc.pdf von
MercerJesse2.1Doc.pdfMercerJesse2.1Doc.pdf
MercerJesse2.1Doc.pdfjessemercerail
169 views5 Folien
UWP OA Week Presentation (1).pptx von
UWP OA Week Presentation (1).pptxUWP OA Week Presentation (1).pptx
UWP OA Week Presentation (1).pptxJisc
88 views11 Folien

Último(20)

Structure and Functions of Cell.pdf von Nithya Murugan
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan545 views
Solar System and Galaxies.pptx von DrHafizKosar
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptx
DrHafizKosar91 views
UWP OA Week Presentation (1).pptx von Jisc
UWP OA Week Presentation (1).pptxUWP OA Week Presentation (1).pptx
UWP OA Week Presentation (1).pptx
Jisc88 views
Drama KS5 Breakdown von WestHatch
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 Breakdown
WestHatch79 views
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... von Ms. Pooja Bhandare
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Sociology KS5 von WestHatch
Sociology KS5Sociology KS5
Sociology KS5
WestHatch70 views
Narration lesson plan.docx von TARIQ KHAN
Narration lesson plan.docxNarration lesson plan.docx
Narration lesson plan.docx
TARIQ KHAN112 views
Classification of crude drugs.pptx von GayatriPatra14
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptx
GayatriPatra1486 views
Create a Structure in VBNet.pptx von Breach_P
Create a Structure in VBNet.pptxCreate a Structure in VBNet.pptx
Create a Structure in VBNet.pptx
Breach_P75 views
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively von PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 585 views
REPRESENTATION - GAUNTLET.pptx von iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood100 views
Class 10 English notes 23-24.pptx von TARIQ KHAN
Class 10 English notes 23-24.pptxClass 10 English notes 23-24.pptx
Class 10 English notes 23-24.pptx
TARIQ KHAN131 views

[removed]DevelopingTechnical Software As.docx

  • 1. [removed] Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 1 COS10007 - Developing Technical Software Assignment (4 x 6.25= 25 Marks) Submission Requirements 1. No zip files, no multiple files 2. Submit only one file 3. Copy and paste your codes into one word document 4. Copy and paste the screen shot of the output window in the same word document 5. Use only .doc, .docx extensions – no other format will be
  • 2. accepted for marking You may be asked to demonstrate/explain your work to the tutor, if you are absent/unavailable or fail to demonstrate properly, zero marks will be awarded. Please note, this is an individual task and it will be checked for plagiarism. Both parties will be penalised if any plagiarism found. Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 2 Qn 1. Creating Linked List in C Create a linked list using the following structure struct studentid { int id; struct studentid *next; }; typedef struct studentid STUDENTid; typedef STUDENTid *STUDENTidPtr; You have to create a linked list manually similar to week 4 Qn1 lab exercise. The re should be five nodes in the linked list and the elements should be the last 5 digits of your student id . One d igit will
  • 3. go to one node and the node insertion should happen in order similar to week 4 Qn 1 . Eg: Assume your student id is 100989674, take the last five digits which is 89674 so the insertion order is newptr= ... ... ..malloc( STUDENTid ); newptr - >id=8; . . . 9 . . 6 . 7 . . 4 and the final linked list should b e 4 6 7 9 8 NULL
  • 4. Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 3 Qn2. Write the following functions in C program, assuming the node type used is as follows: struct node { int data; struct node* next; }; and head is the head pointer of a list: struct node* head; a) Write a sortedMerge() function in C program that taking two lists, each of which is sorted in increasing order, and merges the two together into one list which is increasing order. This function should return a new list, which should be intertwining the nodes of the first two lists. You should consider various cases, e.g. i. either 'a' or 'b' may be empty, ii. during processing either 'a' or 'b' may run out first You should use the following function header: struct node* sortedMerge(struct node* a, struct node* b) { /* Your code... */ b) Write another function named removeRedundant() which
  • 5. takes a list sorted in increasing order and deletes any duplicate nodes from the list. Ideally, the list should only be traversed once. /* Remove duplicates from a sorted list. */ void removeRedundant(struct node* head) { // Your code... Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 4 Qn3. Write a complete C++ program to compute the value of a given position in Pascal's Triangle. To compute the value at any give n position, just add up the numbers to the position's right and left in the previous row (see picture below). For example, to get the middle number in the 5th row, add 3 and 3 (from the 4th row). The sides of the triangle are always 1, as it only add t he number of the upper left or the upper right, where there is no second number on the other side. Your program should prompt the user to input a row and a position in the row. The program should ensure that the input is valid before computing a value for the position. Then your trianglePascal()
  • 6. function will take this two parameters for calculation. Developing Technical Software Assignment TP3 2016 © S w i n b u r n e U n i v e r s i t y o f T e c h n o l o g y Page 5 Q4. Write a complete C program, that Uses a one - dimension array to read 20 numbers, each of them is between 0 and 100, inclusive. a. Uses a selectionSort() function to sort the array in ascending order. Discuss the Big O of your sorting algorithm for the best case and worst case scenarios. b. Write another function that improve the performance of your program by using another sorting algorithm (any algorithm learned in the lecture), discuss the Big O of the new algorithm used.