The document summarizes the output of various algorithms implemented by Nidhi Shanbhag over 4 weeks:
Week 11 included 0/1 knapsack using backtracking and branch and bound, showing the optimal profits and weights.
Week 12 featured the KMP and Boyer-Moore pattern matching algorithms, displaying where patterns were found in texts.
Week 13 described Huffman encoding for text compression and generating codes for characters.
Week 14 showed the longest common subsequence between two strings and the length and subsequence.
The document summarizes the output of various algorithms implemented by Nidhi Shanbhag over 4 weeks:
Week 11 included 0/1 knapsack using backtracking and branch and bound, showing the optimal profits and weights.
Week 12 featured the KMP and Boyer-Moore pattern matching algorithms, displaying where patterns were found in texts.
Week 13 described Huffman encoding for text compression and generating codes for characters.
Week 14 showed the longest common subsequence between two strings and the length and subsequence.
The document summarizes the output of various algorithms implemented by Nidhi Shanbhag over 4 weeks:
Week 11 included 0/1 knapsack using backtracking and branch and bound, showing the optimal profits and weights.
Week 12 featured the KMP and Boyer-Moore pattern matching algorithms, displaying where patterns were found in texts.
Week 13 described Huffman encoding for text compression and generating codes for characters.
Week 14 showed the longest common subsequence between two strings and the length and subsequence.
PS D:\SE SEM IV\MADF LAB> ./a.exe Enter the number of elements: 4 Enter the capacity of the knapsack: 8 Enter the weights of the elements: 2 3 4 5 Enter the profits of the elements: 3 5 6 10
The optimal solution is: 0 1 0 1
The optimal profit is: 15
The optimal weight is: 8
PS D:\SE SEM IV\MADF LAB>
Week 12:
1. 0/1 Knapsack using branch and bound
Output:
PS D:\SE SEM IV\MADF LAB> gcc knapsackbnb.c
PS D:\SE SEM IV\MADF LAB> ./a.exe Enter knapsack cap: 12 Enter the number of items: 4 Enter the profit and weight for each item: 24 2 30 5 20 4 28 7 Knapsack Solution Max Profit = 74 Items Included: 1 1 1 0 PS D:\SE SEM IV\MADF LAB> Week 13:
1.KMP Pattern Matching Algorithm
Output:
PS D:\SE SEM IV\MADF LAB> gcc kmp.c
PS D:\SE SEM IV\MADF LAB> ./a.exe Text is: aabbbaababbbabab Pattern is: bbaba Pattern bbaba found at index 10 in aabbbaababbbabab PS D:\SE SEM IV\MADF LAB>
2. Boyer Moore Pattern Matching Algorithm
Output:
PS D:\SE SEM IV\MADF LAB> gcc bmp.c
PS D:\SE SEM IV\MADF LAB> ./a.exe String 1 is: 1123114234112113 String 2 is: 4112113 Pattern 4112113 found at index 9 in 1123114234112113 PS D:\SE SEM IV\MADF LAB>
Week 14:
1.Huffman Encoding (Text Compression)
Output:
PS D:\SE SEM IV\MADF LAB> gcc huffman.c
PS D:\SE SEM IV\MADF LAB> ./a.exe Huffman Codes n 000 s 0010 p 0011 f 01000 a 01001 m 01010 r 010110 g 010111 e 011 i 100 t 101 110 o 1110 j 111100 l 111101 h 11111 PS D:\SE SEM IV\MADF LAB>
2. LCS (Text Similarity)
Output:
PS D:\SE SEM IV\MADF LAB> gcc lcs.c
PS D:\SE SEM IV\MADF LAB> ./a.exe The string 1 is KLOKMKNKLOK The string 2 is KLLKNKLLKNYY Length of the longest common subsequence is: 7 The longest subsequence is: KLKNKLK PS D:\SE SEM IV\MADF LAB>
Department of Computer ENGINEERING - Networks College of Computer & Information System Jazan University, Jazan Kingdom of Saudi Arabia Laboratory Manual Microprocessor & Assembly Language (CNET 315)