title

9.1 Huffman Coding -Greedy Method |Data Structures Tutorials

description

In this video, I have explained How to Compress a Message using Fixed Sized Codes and Variable Sized Codes(Huffman Coding) with proper example.
DSA Full Course: https: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bbKJzrsKfMpo_grxuLl8LU
******************************************
See Complete Playlists:
C Programming Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31a8UcMN9-35ghv8qyFWD9_S
C++ Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YU5Wx1dopka58teWP9aCee
Python Full Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bZSiqiOL5ta39vSnBxpOPT
Printing Pattern in C: https://www.youtube.com/playlist?list=PLdo5W4Nhv31Yu1igxTE2x0aeShbKtVcCy
DAA Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31ZTn2P9vF02bkb3SC8uiUUn
Placement Series: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YvlDpJhvOYbM9Ap8UypgEy
Dynamic Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31aBrJE1WS4MR9LRfbmZrAQu
Operating Systems: //www.youtube.com/playlist?list=PLdo5W4Nhv31a5ucW_S1K3-x6ztBRD-PNa
DBMS: https://www.youtube.com/playlist?list=PLdo5W4Nhv31b33kF46f9aFjoJPOkdlsRc
*****************************************
Connect & Contact Me:
Facebook: https://www.facebook.com/Jennys-Lectures-CSIT-Netjrf-316814368950701/
Quora: https://www.quora.com/profile/Jayanti-Khatri-Lamba
Instagram: https://www.instagram.com/jayantikhatrilamba/
#huffmancoding #datastructures #jennyslectures

detail

{'title': '9.1 Huffman Coding -Greedy Method |Data Structures Tutorials', 'heatmap': [{'end': 698.436, 'start': 670.294, 'weight': 0.744}, {'end': 1636.483, 'start': 1573.697, 'weight': 0.799}, {'end': 1823.336, 'start': 1798.368, 'weight': 0.99}], 'summary': 'Covers huffman coding, a data compression technique, illustrating the reduction in file size and transfer cost through variable-length coding, fixed vs. variable length coding with an example reducing 160 bits to 60 bits, priority queue algorithm for character frequency, tree node merging, basics of assigning shorter codes to high-frequency characters, and the principles of huffman coding leading to 97 bits transferred with a time complexity of theta n log n.', 'chapters': [{'end': 63.308, 'segs': [{'end': 43.796, 'src': 'embed', 'start': 0.603, 'weight': 0, 'content': [{'end': 1.964, 'text': 'hi guys, welcome back.', 'start': 0.603, 'duration': 1.361}, {'end': 4.946, 'text': "today's topic is huffman coding.", 'start': 1.964, 'duration': 2.982}, {'end': 10.749, 'text': 'huffman coding, or you can say huffman algorithm, is what it is a data compression technique or compression.', 'start': 4.946, 'duration': 5.803}, {'end': 18.494, 'text': 'or you can say, or you can say data compression algorithm, or it can also be known as variable length coding algorithm, in which data,', 'start': 10.749, 'duration': 7.745}, {'end': 22.457, 'text': 'the size of data, is to be reduced or the message is to be produced.', 'start': 18.494, 'duration': 3.963}, {'end': 28.622, 'text': 'see, sometimes when you store something in your computer and the size is size of that file is very big,', 'start': 23.337, 'duration': 5.285}, {'end': 34.288, 'text': 'then what you do is you compress that file and then you store that file in your computer computer so that it will take less time.', 'start': 28.622, 'duration': 5.666}, {'end': 40.334, 'text': "okay, so that's what the compression means reducing the size of the message, okay.", 'start': 34.288, 'duration': 6.046}, {'end': 43.796, 'text': 'secondly, when you want to transfer something on network, when?', 'start': 40.334, 'duration': 3.462}], 'summary': 'Huffman coding is a data compression technique to reduce message size and transfer data efficiently.', 'duration': 43.193, 'max_score': 0.603, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY603.jpg'}], 'start': 0.603, 'title': 'Huffman coding', 'summary': 'Discusses huffman coding, a data compression technique, which reduces the size of data and decreases the cost of transferring files on a network by using variable-length coding algorithm.', 'chapters': [{'end': 63.308, 'start': 0.603, 'title': 'Huffman coding: data compression technique', 'summary': 'Discusses huffman coding, a data compression technique, which reduces the size of data and decreases the cost of transferring files on a network by using variable-length coding algorithm.', 'duration': 62.705, 'highlights': ['Huffman coding is a data compression technique or compression algorithm, also known as variable length coding algorithm, which reduces the size of data or the message to be produced.', 'Compression helps in reducing the size of a file, making it quicker to store and transfer, thus reducing the cost and the bits used to represent the message.', 'Huffman coding is used to reduce the size of data, making it quicker to store and transfer, thereby decreasing the cost involved.']}], 'duration': 62.705, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY603.jpg', 'highlights': ['Huffman coding reduces the size of data or the message to be produced.', 'Compression helps in reducing the size of a file, making it quicker to store and transfer, thus reducing the cost and the bits used to represent the message.', 'Huffman coding is used to reduce the size of data, making it quicker to store and transfer, thereby decreasing the cost involved.']}, {'end': 980.195, 'segs': [{'end': 255.07, 'src': 'embed', 'start': 182.214, 'weight': 1, 'content': [{'end': 189.917, 'text': '20 characters are there and for each character, how many bits will be used to represent that character?', 'start': 182.214, 'duration': 7.703}, {'end': 194.699, 'text': 'because computer you know computer only understand the language of 0 and 1.', 'start': 189.917, 'duration': 4.782}, {'end': 208.962, 'text': 'okay, 20 into 8, that is, 160 bits will be used to transfer this message normally, without using any compression technique.', 'start': 194.699, 'duration': 14.263}, {'end': 211.783, 'text': '160 bits is to be used.', 'start': 208.962, 'duration': 2.821}, {'end': 218.925, 'text': 'okay, now see, this is also known as what fixed length coding.', 'start': 211.783, 'duration': 7.142}, {'end': 221.186, 'text': 'why this is known as fixed length coding?', 'start': 218.925, 'duration': 2.261}, {'end': 229.968, 'text': 'because each character see, each character is simply a string of zeros and ones.', 'start': 222.165, 'duration': 7.803}, {'end': 235.97, 'text': 'okay, and each character is having eight bits fixed length.', 'start': 229.968, 'duration': 6.002}, {'end': 239.971, 'text': 'we have see, a is a is represented by this one.', 'start': 235.97, 'duration': 4.001}, {'end': 249.895, 'text': 'b is what b is a sky code is what 66 and 66 would be converted into this binary form and binary form, and this would be zero one.', 'start': 239.971, 'duration': 9.924}, {'end': 255.07, 'text': 'Something like that.', 'start': 254.369, 'duration': 0.701}], 'summary': 'Each character is represented by 8 bits, totaling 160 bits for 20 characters.', 'duration': 72.856, 'max_score': 182.214, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY182214.jpg'}, {'end': 547.549, 'src': 'embed', 'start': 513.335, 'weight': 0, 'content': [{'end': 516.698, 'text': 'Now, how many total bit are required to transfer this message?', 'start': 513.335, 'duration': 3.363}, {'end': 520.321, 'text': 'Total bits we have what?', 'start': 517.198, 'duration': 3.123}, {'end': 523.585, 'text': '20 into for each character.', 'start': 520.341, 'duration': 3.244}, {'end': 524.986, 'text': 'how many bits are to be used??', 'start': 523.585, 'duration': 1.401}, {'end': 526.768, 'text': 'Three bits for each character.', 'start': 525.226, 'duration': 1.542}, {'end': 530.551, 'text': '20 into three, that is 60 bits.', 'start': 526.768, 'duration': 3.783}, {'end': 535.727, 'text': 'fine here.', 'start': 534.807, 'duration': 0.92}, {'end': 538.768, 'text': 'bits was 120, 160 bits.', 'start': 535.727, 'duration': 3.041}, {'end': 544.689, 'text': 'sorry. now in this case one more thing is what the main funda is.', 'start': 538.768, 'duration': 5.921}, {'end': 547.549, 'text': 'the problem will be there when decoding that message.', 'start': 544.689, 'duration': 2.86}], 'summary': 'To transfer the message, 20 characters at 3 bits each require 60 bits.', 'duration': 34.214, 'max_score': 513.335, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY513335.jpg'}, {'end': 651.657, 'src': 'embed', 'start': 618.122, 'weight': 4, 'content': [{'end': 623.264, 'text': '001 means b, c, d and e, something like this.', 'start': 618.122, 'duration': 5.142}, {'end': 626.885, 'text': 'so this table will also be send.', 'start': 623.264, 'duration': 3.621}, {'end': 631.506, 'text': 'now for sending this table, obviously some bits will be required.', 'start': 626.885, 'duration': 4.621}, {'end': 634.607, 'text': 'see this, 60 bits are just for this message.', 'start': 631.506, 'duration': 3.101}, {'end': 636.748, 'text': 'now, here we are sending this table.', 'start': 634.607, 'duration': 2.141}, {'end': 640.67, 'text': 'also in case of normal message when you were transferring.', 'start': 636.748, 'duration': 3.922}, {'end': 651.657, 'text': 'no need of transferring the table, because by default 8 bits will be required, and everyone knows that value of A is 65, means coding will be used.', 'start': 640.67, 'duration': 10.987}], 'summary': 'Sending the table requires 60 bits, while normal messages need 8 bits for coding.', 'duration': 33.535, 'max_score': 618.122, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY618122.jpg'}, {'end': 698.436, 'src': 'heatmap', 'start': 670.294, 'weight': 0.744, 'content': [{'end': 678.357, 'text': 'Then characters kaise send hongi? Characters will be converted into that is sky code then into the binary form.', 'start': 670.294, 'duration': 8.063}, {'end': 682.599, 'text': 'And binary form mein kya hoga? Each character would take what? How many bits? 8 bits.', 'start': 678.738, 'duration': 3.861}, {'end': 685.541, 'text': 'Now we have what? 5 characters.', 'start': 683.98, 'duration': 1.561}, {'end': 690.203, 'text': 'Into For each character how many bits would required? 8.', 'start': 687.101, 'duration': 3.102}, {'end': 693.204, 'text': 'Theek hai?', 'start': 690.203, 'duration': 3.001}, {'end': 698.436, 'text': '40 bits plus.', 'start': 696.335, 'duration': 2.101}], 'summary': '5 characters will be converted into 40 bits binary code.', 'duration': 28.142, 'max_score': 670.294, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY670294.jpg'}, {'end': 819.293, 'src': 'embed', 'start': 788.44, 'weight': 2, 'content': [{'end': 789.941, 'text': 'Now, what is variable length coding?', 'start': 788.44, 'duration': 1.501}, {'end': 791.702, 'text': 'What will happen in Huffman coding?', 'start': 790.621, 'duration': 1.081}, {'end': 799.25, 'text': 'Maybe A would be represented with 3 bits and B would be represented with 2 bits.', 'start': 793.109, 'duration': 6.141}, {'end': 801.59, 'text': 'Maybe C would be represented with 2 bits.', 'start': 799.67, 'duration': 1.92}, {'end': 803.691, 'text': 'D would be represented with 3 bits.', 'start': 802.051, 'duration': 1.64}, {'end': 805.451, 'text': 'E maybe with 4 bits.', 'start': 804.251, 'duration': 1.2}, {'end': 807.231, 'text': 'So this is variable.', 'start': 806.191, 'duration': 1.04}, {'end': 811.292, 'text': 'Because in this case, every character is represented with 3 bits.', 'start': 807.711, 'duration': 3.581}, {'end': 811.972, 'text': 'That is fixed.', 'start': 811.352, 'duration': 0.62}, {'end': 819.293, 'text': 'But in Huffman coding, maybe A would be represented with 3, 2, then B with 2 bits and C with 2 bits.', 'start': 812.072, 'duration': 7.221}], 'summary': 'Variable length coding assigns different bit lengths to characters, e.g. a=3, b=2, c=2, d=3, e=4.', 'duration': 30.853, 'max_score': 788.44, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY788440.jpg'}], 'start': 63.308, 'title': 'Fixed vs variable length coding', 'summary': "Explores fixed length coding, illustrating with an example message requiring 160 bits without compression, and explains the technique's impact and relevance in data compression, showing a reduction to 60 bits using 3 bits to represent each character.", 'chapters': [{'end': 289.299, 'start': 63.308, 'title': 'Fixed vs variable length coding', 'summary': 'Discusses fixed length coding and the impact of using 8 bits to represent each character, with an example message requiring 160 bits without compression, illustrating the concept of fixed length coding and its relevance in data compression.', 'duration': 225.991, 'highlights': ['Each character is represented with 8 bits, requiring 160 bits for a 20-character message without compression. Without compression, a 20-character message would require 160 bits, as each character is represented with 8 bits.', 'Illustration of fixed length coding using specific characters (A, B, C, D, and E) and their binary representations. The speaker provides examples of A, B, C, D, and E, showing their binary representations and the fixed length coding approach.', 'Explanation of fixed length coding and its association with each character being a string of 8 bits. Fixed length coding is defined as each character being a string of 8 bits, illustrating the concept of fixed length coding.']}, {'end': 547.549, 'start': 289.299, 'title': 'Fixed length coding technique', 'summary': 'Explains the concept of fixed length coding, where a simple message without compression would require 160 bits, and using 3 bits to represent each character reduces the message cost to 60 bits.', 'duration': 258.25, 'highlights': ['Using 3 bits to represent each character reduces the message cost to 60 bits. By using 3 bits to represent each character, the message cost is reduced from 160 bits to 60 bits.', 'A simple message without compression would require 160 bits. Without using any compression technique, a simple message would require 160 bits for transmission.', 'With the help of 3 bits, 8 different combinations are possible, allowing representation of 8 different characters. With 3 bits, 8 different combinations are possible, which enables the representation of 8 different characters.', 'A simple funda is used to represent characters using varying numbers of bits, such as 2 bits for 4 characters and 3 bits for 8 characters. The concept of representing characters using varying numbers of bits is explained, such as using 2 bits for 4 characters and 3 bits for 8 characters.', 'The problem arises when decoding the message using the fixed length coding technique. The chapter mentions a potential problem with decoding the message when using the fixed length coding technique.']}, {'end': 980.195, 'start': 547.549, 'title': 'Encoding and decoding techniques', 'summary': 'Discusses the challenges in message decoding, the need for sending a decoding table with messages, the comparison of fixed length coding and variable length coding using huffman coding, and the steps to design a huffman tree based on character frequency.', 'duration': 432.646, 'highlights': ['The need for sending a decoding table with messages Explains the necessity of sending a decoding table along with the message to aid the receiver in decoding, requiring additional bits and resulting in a total of 115 bits for sending both the message and the table.', 'Comparison of fixed length coding and variable length coding using Huffman coding Contrasts fixed length coding with variable length coding using Huffman coding, outlining the flexibility of variable length coding and the representation of characters with varying bit lengths.', 'Steps to design a Huffman tree based on character frequency Details the process of designing a Huffman tree based on character frequency, involving arranging characters in increasing order of frequency, merging nodes, and creating a parent node with the sum of the frequencies.']}], 'duration': 916.887, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY63308.jpg', 'highlights': ['Using 3 bits to represent each character reduces the message cost to 60 bits.', 'Each character is represented with 8 bits, requiring 160 bits for a 20-character message without compression.', 'Comparison of fixed length coding and variable length coding using Huffman coding.', 'Illustration of fixed length coding using specific characters (A, B, C, D, and E) and their binary representations.', 'The need for sending a decoding table with messages.', 'Explanation of fixed length coding and its association with each character being a string of 8 bits.']}, {'end': 1221.122, 'segs': [{'end': 1075.677, 'src': 'embed', 'start': 1045.273, 'weight': 1, 'content': [{'end': 1050.018, 'text': 'Now arrange this 7, 5 and 8 in increasing order of their frequency count.', 'start': 1045.273, 'duration': 4.745}, {'end': 1055.502, 'text': 'So first of all what we will write this node 5, then 7 and then 8.', 'start': 1050.038, 'duration': 5.464}, {'end': 1063.372, 'text': 'Now out of these three take two characters having minimum frequency we will take this 5 and this 8.', 'start': 1055.502, 'duration': 7.87}, {'end': 1068.334, 'text': 'minimum see, you have to keep in mind always the minimum count.', 'start': 1063.372, 'duration': 4.962}, {'end': 1075.677, 'text': 'frequency count would be left side, okay, and the you know that greater than that minimum would be on right side.', 'start': 1068.334, 'duration': 7.343}], 'summary': 'Arranged 7, 5, and 8 in increasing frequency order.', 'duration': 30.404, 'max_score': 1045.273, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1045272.jpg'}, {'end': 1122.66, 'src': 'embed', 'start': 1092.988, 'weight': 0, 'content': [{'end': 1099.649, 'text': 'we have this node 5 and we are merging this 7 with this 5.', 'start': 1092.988, 'duration': 6.661}, {'end': 1103.77, 'text': 'then we will write this 7 at this level, only this level only.', 'start': 1099.649, 'duration': 4.121}, {'end': 1105.431, 'text': 'you will not write 7 here.', 'start': 1103.77, 'duration': 1.661}, {'end': 1108.152, 'text': 'okay, you will write 7 here for 7.', 'start': 1105.431, 'duration': 2.721}, {'end': 1108.972, 'text': 'what we have?', 'start': 1108.152, 'duration': 0.82}, {'end': 1113.453, 'text': 'B and merge these two and the total would be what.', 'start': 1108.972, 'duration': 4.481}, {'end': 1116.789, 'text': 'Now we have done this with this B.', 'start': 1114.905, 'duration': 1.884}, {'end': 1119.414, 'text': 'Now only left frequencies are this node.', 'start': 1116.789, 'duration': 2.625}, {'end': 1122.66, 'text': 'One is this node having frequency 8 frequency count and one is B.', 'start': 1119.514, 'duration': 3.146}], 'summary': 'Merging node 7 with 5, resulting in a total frequency of 8.', 'duration': 29.672, 'max_score': 1092.988, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1092988.jpg'}], 'start': 980.195, 'title': 'Priority queue algorithm and tree node merging process', 'summary': 'Explains arranging characters in a priority queue based on frequency count and forming a tree structure. it also covers the process of merging tree nodes based on frequency, leading to the formation of a final tree.', 'chapters': [{'end': 1092.988, 'start': 980.195, 'title': 'Priority queue algorithm', 'summary': 'Explains the process of arranging characters in a priority queue based on their frequency count and forming a tree structure, demonstrating the steps with specific characters and their frequency counts, including a final tree representation.', 'duration': 112.793, 'highlights': ['The characters are arranged in a priority queue based on their frequency count, with specific examples of characters and their counts provided.', 'The process of forming a tree structure is explained, emphasizing the selection of characters with the least frequency count and their positioning in the tree.', 'The detailed steps of arranging characters and forming the tree are demonstrated with a specific focus on the frequency counts and the corresponding character selections.']}, {'end': 1221.122, 'start': 1092.988, 'title': 'Tree node merging process', 'summary': 'Explains the process of merging tree nodes and arranging them based on frequency, leading to the formation of a final tree with characters at the leaf nodes.', 'duration': 128.134, 'highlights': ['The merging process involves combining nodes based on their frequencies, such as merging 7 with 5 to form a node with a total frequency of 12.', 'Arranging the remaining nodes in increasing order of frequency, with the minimum frequency on the left side and the greater frequency on the right side, ultimately resulting in the formation of the final tree.', 'The final tree consists of characters at the leaf nodes, represented by E, A, D, C, and B, following the merging and arrangement process.']}], 'duration': 240.927, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY980195.jpg', 'highlights': ['The merging process involves combining nodes based on their frequencies, such as merging 7 with 5 to form a node with a total frequency of 12.', 'The characters are arranged in a priority queue based on their frequency count, with specific examples of characters and their counts provided.', 'The process of forming a tree structure is explained, emphasizing the selection of characters with the least frequency count and their positioning in the tree.', 'Arranging the remaining nodes in increasing order of frequency, with the minimum frequency on the left side and the greater frequency on the right side, ultimately resulting in the formation of the final tree.']}, {'end': 1436.296, 'segs': [{'end': 1247.267, 'src': 'embed', 'start': 1221.562, 'weight': 2, 'content': [{'end': 1227.764, 'text': 'Now second step is what you have to traverse this tree and you have to assign 0 and 1.', 'start': 1221.562, 'duration': 6.202}, {'end': 1233.205, 'text': 'Now 0 would be assigned to the left side and 1 would be assigned to the right child.', 'start': 1227.764, 'duration': 5.441}, {'end': 1242.526, 'text': 'So 20 ka left child hai this one 0 would be assigned here to the left side 0 would be assigned right side 1 right side 1.', 'start': 1233.625, 'duration': 8.901}, {'end': 1243.406, 'text': 'now see this one.', 'start': 1242.526, 'duration': 0.88}, {'end': 1244.766, 'text': 'this is right of 8.', 'start': 1243.406, 'duration': 1.36}, {'end': 1246.367, 'text': 'then 1 would be assigned.', 'start': 1244.766, 'duration': 1.601}, {'end': 1247.267, 'text': 'now 12.', 'start': 1246.367, 'duration': 0.9}], 'summary': 'Traverse tree, assign 0 to left, 1 to right. example: 20 - 0, 8 right - 1, 12.', 'duration': 25.705, 'max_score': 1221.562, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1221562.jpg'}, {'end': 1414.427, 'src': 'embed', 'start': 1344.399, 'weight': 0, 'content': [{'end': 1348.482, 'text': 'frequency of, or you can say the count of B is what highest.', 'start': 1344.399, 'duration': 4.083}, {'end': 1355.932, 'text': 'so the letter or the character having the highest or the maximum pound the character which is generating more.', 'start': 1349.628, 'duration': 6.304}, {'end': 1360.035, 'text': 'you know many times which that character will have.', 'start': 1355.932, 'duration': 4.103}, {'end': 1363.518, 'text': 'the halfman code having less number of bits.', 'start': 1360.035, 'duration': 3.483}, {'end': 1373.565, 'text': 'halfman code of this b is what having two bits and for two see d is occurring two times, and halfman code for this two is what having three bits.', 'start': 1363.518, 'duration': 10.047}, {'end': 1381.971, 'text': 'maybe some character is there which is occurring 1 times and the Huffman code of that character would be of 4 bits.', 'start': 1375.325, 'duration': 6.646}, {'end': 1384.634, 'text': 'so the character whose frequency will be maximum will have less bits in Huffman code.', 'start': 1381.971, 'duration': 2.663}, {'end': 1399.323, 'text': 'that is the rule and thus Huffman coding will also satisfy the prefix rule.', 'start': 1384.634, 'duration': 14.689}, {'end': 1401.083, 'text': 'I will discuss that rule in later.', 'start': 1399.323, 'duration': 1.76}, {'end': 1408.245, 'text': 'first of all, let us find out the size of what you can say the you know number of total number of bits in transferring.', 'start': 1401.083, 'duration': 7.162}, {'end': 1414.427, 'text': 'while you are transferring this message, how many total number of bits would be transferred for this message?', 'start': 1408.245, 'duration': 6.182}], 'summary': 'Huffman coding reduces bits for characters based on frequency, satisfying prefix rule.', 'duration': 70.028, 'max_score': 1344.399, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1344399.jpg'}], 'start': 1221.562, 'title': 'Huffman coding basics', 'summary': 'Explains the process of assigning shorter codes to characters with higher frequency, reducing the total number of bits required for message transfer and satisfying the prefix rule, demonstrating through an example of character frequency and corresponding huffman codes.', 'chapters': [{'end': 1344.399, 'start': 1221.562, 'title': 'Huffman coding explanation', 'summary': 'Explains the process of assigning 0s and 1s to tree edges, finding huffman coding for characters, and the concept of variable length coding, with a having a code of 01, b having a code of 11, c having a code of 101, d having a code of 100, and e having a code of 00.', 'duration': 122.837, 'highlights': ['The coding for A is 01, for B is 11, for C is 101, for D is 100, and for E is 00, showcasing the variable length coding concept.', "Explains the process of assigning 0 and 1 to tree edges based on left and right child, with specific examples like 20's left child being 0 and right child being 1, and similar assignments for other nodes.", 'Discusses the concept of variable length coding, highlighting that A is represented with two bits, C and D with three bits, and emphasizing the variable nature of the codes for each character.']}, {'end': 1436.296, 'start': 1344.399, 'title': 'Huffman coding basics', 'summary': 'Explains how huffman coding assigns shorter codes to characters with higher frequency, reducing the total number of bits required for message transfer and satisfying the prefix rule, demonstrating through an example of character frequency and corresponding huffman codes.', 'duration': 91.897, 'highlights': ["Huffman coding assigns shorter codes to characters with higher frequency, reducing the total number of bits required for message transfer. For example, character 'b' with a frequency of 2 has a Huffman code of 2 bits, while 'd' with a frequency of 2 has a Huffman code of 3 bits.", 'Huffman coding satisfies the prefix rule, ensuring efficient data compression and transmission.', 'The frequency of a character directly impacts the number of bits in its Huffman code, with characters of higher frequency having shorter codes.']}], 'duration': 214.734, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1221562.jpg', 'highlights': ['Huffman coding assigns shorter codes to characters with higher frequency, reducing the total number of bits required for message transfer.', 'The frequency of a character directly impacts the number of bits in its Huffman code, with characters of higher frequency having shorter codes.', "Explains the process of assigning 0 and 1 to tree edges based on left and right child, with specific examples like 20's left child being 0 and right child being 1, and similar assignments for other nodes.", 'Huffman coding satisfies the prefix rule, ensuring efficient data compression and transmission.']}, {'end': 2043.722, 'segs': [{'end': 1636.483, 'src': 'heatmap', 'start': 1573.697, 'weight': 0.799, 'content': [{'end': 1577.9, 'text': 'now for sending these characters, how these characters will be sent.', 'start': 1573.697, 'duration': 4.203}, {'end': 1581.422, 'text': 'see characters will be sent, what the characters would be converted into sk code.', 'start': 1577.9, 'duration': 3.522}, {'end': 1586.186, 'text': 'then sk code say character kaise convert hongi into 8 bit binary form?', 'start': 1581.422, 'duration': 4.764}, {'end': 1590.888, 'text': 'okay, Now we have how many characters? 5 characters.', 'start': 1586.186, 'duration': 4.702}, {'end': 1594.75, 'text': 'Into each character would be represented with 8 bits in a sky code.', 'start': 1591.528, 'duration': 3.222}, {'end': 1599.352, 'text': 'Then 5 into 8 that is 40.', 'start': 1595.25, 'duration': 4.102}, {'end': 1604.355, 'text': 'Now along with these characters, these Huffman code will also be sent.', 'start': 1599.352, 'duration': 5.003}, {'end': 1607.994, 'text': 'For characters, 40 bits would be required.', 'start': 1605.814, 'duration': 2.18}, {'end': 1616.687, 'text': 'For sending these codes, how many bits would be required? 40 plus 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12.', 'start': 1608.114, 'duration': 8.573}, {'end': 1619.897, 'text': 'How many bits are there? 12 bits would be required.', 'start': 1616.696, 'duration': 3.201}, {'end': 1625.058, 'text': 'Now total would be what? 52.', 'start': 1619.917, 'duration': 5.141}, {'end': 1630.039, 'text': 'Now total bits to be transferred from sender to receiver would be 45 plus 52.', 'start': 1625.058, 'duration': 4.981}, {'end': 1636.483, 'text': 'That is 92.', 'start': 1630.039, 'duration': 6.444}], 'summary': 'Sending 5 characters in 8-bit sk code and huffman code requires 92 bits.', 'duration': 62.786, 'max_score': 1573.697, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1573697.jpg'}, {'end': 1671.957, 'src': 'embed', 'start': 1642.665, 'weight': 0, 'content': [{'end': 1647.986, 'text': 'any message using Huffman coding or I am taking example of this message then ninety seven bits would be required.', 'start': 1642.665, 'duration': 5.321}, {'end': 1652.167, 'text': 'ninety seven bits would be used from send from sender to receiver.', 'start': 1647.986, 'duration': 4.181}, {'end': 1653.427, 'text': 'pehle 160 thi uske baad.', 'start': 1652.167, 'duration': 1.26}, {'end': 1659.049, 'text': 'compress karke kitna ho 115 and using Huffman coding it becomes what ninety seven bits.', 'start': 1653.427, 'duration': 5.622}, {'end': 1666.852, 'text': 'okay, now, see how the that you know receiver will decode this message.', 'start': 1660.287, 'duration': 6.565}, {'end': 1671.957, 'text': 'suppose receiver is having this tree in the serialized form.', 'start': 1666.852, 'duration': 5.105}], 'summary': 'Using huffman coding, 97 bits are needed to transmit the message, reducing from 160 to 115 bits.', 'duration': 29.292, 'max_score': 1642.665, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1642665.jpg'}, {'end': 1797.828, 'src': 'embed', 'start': 1765.384, 'weight': 2, 'content': [{'end': 1767.145, 'text': 'The next bit is 0.', 'start': 1765.384, 'duration': 1.761}, {'end': 1768.066, 'text': '1 0.', 'start': 1767.145, 'duration': 0.921}, {'end': 1769.787, 'text': 'Here also we have no character.', 'start': 1768.066, 'duration': 1.721}, {'end': 1772.009, 'text': 'The next bit is 1.', 'start': 1770.307, 'duration': 1.702}, {'end': 1772.769, 'text': '1 0.', 'start': 1772.009, 'duration': 0.76}, {'end': 1775.732, 'text': '1 Yes, we have reached to a character C.', 'start': 1772.769, 'duration': 2.963}, {'end': 1778.554, 'text': 'Like this, the message will be decoded with the help of this.', 'start': 1775.732, 'duration': 2.822}, {'end': 1781.943, 'text': 'Huffman tree.', 'start': 1780.643, 'duration': 1.3}, {'end': 1787.045, 'text': 'so along with the data, along with the message, either the tree or the table would be also be sent.', 'start': 1781.943, 'duration': 5.102}, {'end': 1789.886, 'text': 'okay, obviously, tree would be sent in serialized form only.', 'start': 1787.045, 'duration': 2.841}, {'end': 1797.828, 'text': 'okay, so these are the number of bits would be required when you compress this message, or you will send this message using Huffman coding.', 'start': 1789.886, 'duration': 7.942}], 'summary': 'Using huffman coding decreases message size, requiring fewer bits for compression.', 'duration': 32.444, 'max_score': 1765.384, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1765384.jpg'}, {'end': 1823.336, 'src': 'heatmap', 'start': 1798.368, 'weight': 0.99, 'content': [{'end': 1805.75, 'text': 'complexity of this would be theta n log n.', 'start': 1798.368, 'duration': 7.382}, {'end': 1814.989, 'text': 'Now, see, I have told you one funda, that is prefix code, that Huffman coding works on the technique, that is prefix code.', 'start': 1808.484, 'duration': 6.505}, {'end': 1819.793, 'text': 'What is the prefix code algorithm or what is the prefix code rule you can say.', 'start': 1815.189, 'duration': 4.604}, {'end': 1823.336, 'text': 'It says no code is prefix of another code.', 'start': 1820.534, 'duration': 2.802}], 'summary': 'Huffman coding complexity is θ(n log n), based on prefix code rule', 'duration': 24.968, 'max_score': 1798.368, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1798368.jpg'}, {'end': 1998.413, 'src': 'embed', 'start': 1972.938, 'weight': 1, 'content': [{'end': 1978.728, 'text': 'Okay So, for Huffman coding, you have to keep this in mind.', 'start': 1972.938, 'duration': 5.79}, {'end': 1981.553, 'text': 'Huffman coding will always follow this prefix rule.', 'start': 1978.788, 'duration': 2.765}, {'end': 1985.28, 'text': 'And what is the prefix rule? I have told you through this example.', 'start': 1981.593, 'duration': 3.687}, {'end': 1988.084, 'text': 'now in a summarized way.', 'start': 1986.243, 'duration': 1.841}, {'end': 1990.987, 'text': 'if i tell you the huffman coding, then these are the four points.', 'start': 1988.084, 'duration': 2.903}, {'end': 1995.21, 'text': 'it was discovered or developed by david huffman in 1951.', 'start': 1990.987, 'duration': 4.223}, {'end': 1996.851, 'text': 'next is it in.', 'start': 1995.21, 'duration': 1.641}, {'end': 1998.413, 'text': 'the encoding follows the prefix rule.', 'start': 1996.851, 'duration': 1.562}], 'summary': 'Huffman coding follows prefix rule, discovered by david huffman in 1951.', 'duration': 25.475, 'max_score': 1972.938, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1972938.jpg'}], 'start': 1436.296, 'title': 'Huffman coding principles', 'summary': "Delves into huffman coding, discussing the total bits for message, decoding process, and transmission bits, resulting in 97 bits transferred. it emphasizes the prefix rule's impact on decoding, discovered by david huffman in 1951, with a time complexity of theta n log n.", 'chapters': [{'end': 1839.928, 'start': 1436.296, 'title': 'Huffman coding and decoding', 'summary': 'Discusses the calculation of the total number of bits for a message, the decoding process, and the number of bits required for sending the message using huffman coding, resulting in a total of 97 bits transferred from sender to receiver. it also explains the decoding process using the huffman tree and mentions the time complexity of the process as theta n log n.', 'duration': 403.632, 'highlights': ['The total number of bits required for sending the message using Huffman coding is 97 bits from sender to receiver. The calculation results in 97 bits required for sending the message using Huffman coding, including the message and the corresponding Huffman code.', 'The decoding process of the message using the Huffman tree involves traversing the tree based on the received bits to decode the characters. The receiver decodes the message using the Huffman tree, traversing it based on the received bits to decode the characters, ensuring accurate decoding of the message.', 'The time complexity of the Huffman coding process is theta n log n. The time complexity of the Huffman coding process is analyzed and determined to be theta n log n, providing insight into the efficiency of the process.']}, {'end': 2043.722, 'start': 1839.928, 'title': 'Huffman coding: prefix rule and ambiguity', 'summary': 'Explains the concept of huffman coding, emphasizing the prefix rule, which ensures no code can be a prefix of another code, as discovered by david huffman in 1951. it also highlights the impact of the rule on decoding and the time complexity of huffman coding being theta n log n.', 'duration': 203.794, 'highlights': ['The Huffman coding, discovered by David Huffman in 1951, follows the prefix rule, ensuring no code can be a prefix of another code.', 'The impact of the prefix rule is demonstrated through an example, highlighting the ambiguity in decoding messages due to the prefix codes.', 'The time complexity of Huffman coding is theta n log n, emphasizing its efficiency in encoding and decoding messages.']}], 'duration': 607.426, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/saofdNsZiYY/pics/saofdNsZiYY1436296.jpg', 'highlights': ['The total number of bits required for sending the message using Huffman coding is 97 bits from sender to receiver.', 'The Huffman coding, discovered by David Huffman in 1951, follows the prefix rule, ensuring no code can be a prefix of another code.', 'The decoding process of the message using the Huffman tree involves traversing the tree based on the received bits to decode the characters.']}], 'highlights': ['Huffman coding reduces the size of data or the message to be produced.', 'Compression helps in reducing the size of a file, making it quicker to store and transfer, thus reducing the cost and the bits used to represent the message.', 'Huffman coding is used to reduce the size of data, making it quicker to store and transfer, thereby decreasing the cost involved.', 'Using 3 bits to represent each character reduces the message cost to 60 bits.', 'Each character is represented with 8 bits, requiring 160 bits for a 20-character message without compression.', 'Huffman coding assigns shorter codes to characters with higher frequency, reducing the total number of bits required for message transfer.', 'The total number of bits required for sending the message using Huffman coding is 97 bits from sender to receiver.', 'The Huffman coding, discovered by David Huffman in 1951, follows the prefix rule, ensuring no code can be a prefix of another code.']}