The code in this repository are my solutions for ECE345 labs and Assignments at the University of Toronto. Please do not use it for your own course work, thank you.
- Bonus assignment
- Solution
- Course material
You are given an input file with multiple lines where each line contains a list of words separated by a space. All words contain only lowercase letters (a-z). Write an efficient C++ program to find and output the longest consecutive palindromic sequence of words belonging to every line in the file.
I can only pass 95% of the test case, if you can improve my program performance, please let me know, thank you
• Background: asymptotics, recurrences, combinatorics, randomization, graphs and trees (Chap- ters 1. . .5, Appendices A, B and C) • Sorting: quicksort and analysis, heapsort and analysis, other sorting methods, lower bounds in sorting and selection in linear time (Chapters 6. . .9) • Binary Search trees, Red-Back trees, Amortized Analysis, Splay trees, Hashing (Chapters 10. . .13, 17) • Dynamic Programming and Greedy Algorithms (Chapters 15 and 16) • Basic graph algorithms (breadth-first search, depth-first search) (Chapter 22) • Minimum Spanning Trees and Single Source Shortest Paths (Chapters 23 and 24) • Introduction to theory of computation and NP-Completeness (Chapter 34)