Cody

Solution 1689147

Submitted on 9 Dec 2018 by Aurik Sarker
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'} lastnames = 1×3 cell array {'Google'} {'Snuffy Smith'} {'Dagwood Bumstead'} lastnames = 1×3 cell array {'Google'} {'Smith'} {'Dagwood Bumstead'} lastnames = 1×3 cell array {'Google'} {'Smith'} {'Bumstead'}

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' } lastnames = 12×1 cell array {'Truman' } {'Dwight Eisenhower'} {'John F. Kennedy' } {'Lyndon Johnson' } {'Richard Nixon' } {'Gerald Ford' } {'Cleve Moler' } {'Ronald Reagan' } {'George Bush' } {'Bill Clinton' } {'George Bush' } {'Barack Obama' } lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'John F. Kennedy'} {'Lyndon Johnson' } {'Richard Nixon' } {'Gerald Ford' } {'Cleve Moler' } {'Ronald Reagan' } {'George Bush' } {'Bill Clinton' } {'George Bush' } {'Barack Obama' } lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Lyndon Johnson'} {'Richard Nixon' } {'Gerald Ford' } {'Cleve Moler' } {'Ronald Reagan' } {'George Bush' } {'Bill Clinton' } {'George Bush' } {'Barack Obama' } lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Johnson' } {'Richard Nixon'} {'Gerald Ford' } {'Cleve Moler' } {'Ronald Reagan'} {'George Bush' } {'Bill Clinton' } {'George Bush' } {'Barack Obama' } lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Johnson' } {'Nixon' } {'Gerald Ford' } {'Cleve Moler' } {'Ronald Reagan'} {'George Bush' } {'Bill Clinton' } {'George Bush' } {'Barack Obama' } lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Johnson' } {'Nixon' } {'Ford' } {'Cleve Moler' } {'Ronald Reagan'} {'George Bush' } {'Bill Clinton' } {'George Bush' } {'Barack Obama' } lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Johnson' } {'Nixon' } {'Ford' } {'Moler' } {'Ronald Reagan'} {'George Bush' } {'Bill Clinton' } {'George Bush' } {'Barack Obama' } lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Johnson' } {'Nixon' } {'Ford' } {'Moler' } {'Reagan' } {'George Bush' } {'Bill Clinton'} {'George Bush' } {'Barack Obama'} lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Johnson' } {'Nixon' } {'Ford' } {'Moler' } {'Reagan' } {'Bush' } {'Bill Clinton'} {'George Bush' } {'Barack Obama'} lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Johnson' } {'Nixon' } {'Ford' } {'Moler' } {'Reagan' } {'Bush' } {'Clinton' } {'George Bush' } {'Barack Obama'} lastnames = 12×1 cell array {'Truman' } {'Eisenhower' } {'Kennedy' } {'Johnson' } {'Nixon' } {'Ford' } {'Moler' } {'Reagan' } {'Bush' } {'Clinton' } {'Bush' } {'Barack Obama'} lastnames = 12×1 cell array {'Truman' } {'Eisenhower'} {'Kennedy' } {'Johnson' } {'Nixon' } {'Ford' } {'Moler' } {'Reagan' } {'Bush' } {'Clinton' } {'Bush' } {'Obama' }

Suggested Problems

More from this Author95