Skip to content

Commit

Permalink
-----
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir Paul committed Jun 8, 2022
1 parent 47232e4 commit d0971c1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 49 deletions.
15 changes: 3 additions & 12 deletions codec_implementation.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
/*
Author : Samyak Jain
Created on : 30 June 2020
Author : Samir Paul
*/
// import { MinHeap } from './heap_implementation.js';
// export { Codec };
class Codec {
// constructor() {
// this.codes = {};
// }
class Codec {

/// dfs
getCodes(node, curr_code) {
Expand Down Expand Up @@ -81,10 +75,7 @@ class Codec {
this.heap.push([value, key]);
}

/// alternate way
// mp.forEach(function (value, key) {
// console.log([value, key]);
// })

while (this.heap.size() >= 2) {
let min_node1 = this.heap.top();
this.heap.pop();
Expand Down
4 changes: 2 additions & 2 deletions heap_implementation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Author : Samyak Jain
Created on : 30 June 2020
Author : Samir Paul
*/
// export { MinHeap }
class MinHeap {
Expand Down
49 changes: 24 additions & 25 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
<form method="post" enctype="multipart/form-data" class="form" id="fileform">
<input class="file-input-button" type="file" id="uploadfile" class="input">

<!-- <input type="submit" class="input" id="submitbtn" > -->
<input class="upload-button" type="button" id="submitbtn" class="input" value="Upload ⤒">
</form>
<br>
Expand All @@ -75,36 +74,36 @@
</div>
<br>
<div class="card text-center">
<div class="card-header"> <b>STEP 2</b>: SELECT ACTION </div>
<div class="align" id="step2">
<div class="card-body">
<img height="60" width="60" src="assets/action.gif">
<br>
<!-- &emsp;&emsp;&emsp;&emsp; -->
<button type="button" id="encode" class="button" >Compress ⭳</button>
&nbsp or &nbsp;
<!-- &emsp;&emsp;&emsp;&emsp; -->
<button type="button" id="decode" class="button" >De-compress ⭳</button>
<div class="card-header"> <b>STEP 2</b>: SELECT ACTION </div>
<div class="align" id="step2">
<div class="card-body">
<img height="60" width="60" src="assets/action.gif">
<br>
<!-- &emsp;&emsp;&emsp;&emsp; -->
<button type="button" id="encode" class="button" >Compress ⭳</button>
&nbsp or &nbsp;
<!-- &emsp;&emsp;&emsp;&emsp; -->
<button type="button" id="decode" class="button" >De-compress ⭳</button>
<!-- Select Action -->
<br>
</div>
</div>
<br>
</div>
</div>
</div>
<br>
<div class="card text-center">
<div class="card-header">SIT BACK AND RELAX</div>
<div class="align" id="step3" >
<div class="card-body">
<img height="60" width="60" src="assets/emoji.gif">
<br>
<span class="align" id="text4">
<button class="reload-button" type="button" onclick="location.reload()" >Reload</button> to Start Again!
</span>
<br>
<div class="card-header">SIT BACK AND RELAX</div>
<div class="align" id="step3" >
<div class="card-body">
<img height="60" width="60" src="assets/emoji.gif">
<br>
<span class="align" id="text4">
<button class="reload-button" type="button" onclick="location.reload()" >Reload</button> to Start Again!
</span>
<br>
<!-- Wait a moment -->
</div>
</div>
</div>
</div>
</div>
</div>

</body>
Expand Down
1 change: 1 addition & 0 deletions info.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- Author : Samir Paul -->
<!DOCTYPE html>
<html>

Expand Down
13 changes: 3 additions & 10 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/*
Author : Samyak Jain
Created on : 30 June 2020
Author : Samir Paul
*/
// import { Codec } from "./codec_implementation.js";

/// min heap implementation
class MinHeap {
Expand Down Expand Up @@ -106,9 +104,7 @@ class MinHeap {

/// coder decoder class
class Codec {
// constructor() {
// this.codes = {};
// }


/// dfs
getCodes(node, curr_code) {
Expand Down Expand Up @@ -183,10 +179,7 @@ class Codec {
this.heap.push([value, key]);
}

/// alternate way
// mp.forEach(function (value, key) {
// console.log([value, key]);
// })

while (this.heap.size() >= 2) {
let min_node1 = this.heap.top();
this.heap.pop();
Expand Down

0 comments on commit d0971c1

Please sign in to comment.