Cody

Solution 1918115

Submitted on 1 Sep 2019 by Alvin LAU
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
list = {'Barney Google','Snuffy Smith','Dagwood Bumstead'}; alpha_list = {'Dagwood Bumstead','Barney Google','Snuffy Smith'} assert(isequal(alphabetize(list),alpha_list))

alpha_list = 1×3 cell array {'Dagwood Bumstead'} {'Barney Google'} {'Snuffy Smith'} al = 3×2 cell array {'Dagwood Bumstead'} {'Bumstead'} {'Barney Google' } {'Google' } {'Snuffy Smith' } {'Smith' } al = 3×1 cell array {'Dagwood Bumstead'} {'Barney Google' } {'Snuffy Smith' } al = 1×3 cell array {'Dagwood Bumstead'} {'Barney Google'} {'Snuffy Smith'}

2   Pass
list = {'Harry Truman' 'Dwight Eisenhower' 'John F. Kennedy' 'Lyndon Johnson' 'Richard Nixon' 'Gerald Ford' 'Cleve Moler' 'Ronald Reagan' 'George Bush' 'Bill Clinton' 'George Bush' 'Barack Obama'}; alpha_list = {'George Bush' 'George Bush' 'Bill Clinton' 'Dwight Eisenhower' 'Gerald Ford' 'Lyndon Johnson' 'John F. Kennedy' 'Cleve Moler' 'Richard Nixon' 'Barack Obama' 'Ronald Reagan' 'Harry Truman'} assert(isequal(alphabetize(list),alpha_list))

alpha_list = 12×1 cell array {'George Bush' } {'George Bush' } {'Bill Clinton' } {'Dwight Eisenhower'} {'Gerald Ford' } {'Lyndon Johnson' } {'John F. Kennedy' } {'Cleve Moler' } {'Richard Nixon' } {'Barack Obama' } {'Ronald Reagan' } {'Harry Truman' } al = 12×2 cell array {'George Bush' } {'Bush' } {'George Bush' } {'Bush' } {'Bill Clinton' } {'Clinton' } {'Dwight Eisenhower'} {'Eisenhower'} {'Gerald Ford' } {'Ford' } {'Lyndon Johnson' } {'Johnson' } {'John F. Kennedy' } {'Kennedy' } {'Cleve Moler' } {'Moler' } {'Richard Nixon' } {'Nixon' } {'Barack Obama' } {'Obama' } {'Ronald Reagan' } {'Reagan' } {'Harry Truman' } {'Truman' } al = 12×1 cell array {'George Bush' } {'George Bush' } {'Bill Clinton' } {'Dwight Eisenhower'} {'Gerald Ford' } {'Lyndon Johnson' } {'John F. Kennedy' } {'Cleve Moler' } {'Richard Nixon' } {'Barack Obama' } {'Ronald Reagan' } {'Harry Truman' }