Cody

Solution 435326

Submitted on 25 Apr 2014 by Pascal Geschwill
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 = 'Dagwood Bumstead' 'Barney Google' 'Snuffy Smith' names_rearranged = 'Google Barney' 'Smith Snuffy' 'Bumstead Dagwood' names_rearranged_sorted = 'Bumstead Dagwood' 'Google Barney' 'Smith Snuffy' idx_sorted = 3 1 2 alpha_list = '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 = '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' names_rearranged = 'Truman Harry' 'Eisenhower Dwight' 'Kennedy John F.' 'Johnson Lyndon' 'Nixon Richard' 'Ford Gerald' 'Moler Cleve' 'Reagan Ronald' 'Bush George' 'Clinton Bill' 'Bush George' 'Obama Barack' names_rearranged_sorted = 'Bush George' 'Bush George' 'Clinton Bill' 'Eisenhower Dwight' 'Ford Gerald' 'Johnson Lyndon' 'Kennedy John F.' 'Moler Cleve' 'Nixon Richard' 'Obama Barack' 'Reagan Ronald' 'Truman Harry' idx_sorted = 9 11 10 2 6 4 3 7 5 12 8 1 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'

Suggested Problems

More from this Author95