Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SOLVE WTH MATLAB Check whether a graph is complete or not O solutions submitted (max: 1) Write a function named checkComplete ENList that takes number
SOLVE WTH MATLAB
Check whether a graph is complete or not O solutions submitted (max: 1) Write a function named checkComplete ENList that takes number of nodes (n) and edge-node list representation (E) of a graph and returns (output variable p) 1 if it is complete, and 0 otherwise. For example: Case 1: Input: number of nodes=5 E1=[1 4; 2 4; 34; 4 5; 12; 13; 15; 23; 3 5] Output: 0 Case2: Input: number of nodes=4 E2=[3 4; 12; 23; 14; 24; 13] Output: 1 The code has already been provided to define a function named checkComplete ENList that accepts input variables E and n. In your code, you MUST use adequate loop(s) and conditional(s), use break OR return Note that E and n is defined as input to the function. Do not overwrite values in these variables in your code. Be sure to assign a value to the function output variable (p). Function CR 1 function p=checkCompleteENList(e,n) 2 %Enter the commands for your function here. Code to call your function 1 E1=[1 4; 2 4; 3 4; 4 5; 1 2; 1 3; 1 5; 2 3; 3 5]; 2 n=5; 3 p=checkComplete List(E1,n) Assessment: > is output assigned to "p" correct for case1? (Pretest) Is output assigned to "p" correct for case2? Does the function employs loop(s)? Does the function employs conditional(s)? Does the function employs break OR returnStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started