Skip to content

Commit

Permalink
Merge pull request #60 from raj-rathod/rajesh
Browse files Browse the repository at this point in the history
Rajesh
  • Loading branch information
raj-rathod authored Aug 14, 2022
2 parents 2928664 + bc7c4e1 commit 462cdf8
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>backtracking-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>brute-force-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>divide-and-conquer-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>dynamic-programming-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>greedy-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>hashing-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>randomized-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>recursive-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>searching-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>sorting-algorithm works!</p>
<p class="text-center mt-5">Coming soon</p>
17 changes: 8 additions & 9 deletions src/app/core/algorithms/algorithms-meta-data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Helper } from "src/app/helper/helper"

const algorithms = {
const algorithmsData = {
defination:"An algorithm is a procedure used for solving a problem or performing a computation. Algorithms act as an exact list of instructions that conduct specified actions step by step in either hardware- or software-based routines",
characteristics:[
"<b>Clear and Unambiguous</b>: The algorithm should be clear and unambiguous. Each of its steps should be clear in all aspects and must lead to only one meaning",
Expand Down Expand Up @@ -49,11 +48,11 @@ const algorithms = {
}

export const algorithmMetaData = {
defination: Helper.setHeader(algorithms.defination),
characteristics: Helper.setListwithTitleHtml("What are the Characteristics of an Algorithm", algorithms.characteristics),
properties: Helper.setListwithTitleHtml("Properties of Algorithm", algorithms.properties),
types: Helper.setListwithTitleHtml("Types of Algorithm", algorithms.types),
others: Helper.setListwithTitleHtml("How to Design an Algorithm", algorithms.others),
advantages: Helper.setListwithTitleHtml("Advantages", algorithms.advantages),
disadvantages: Helper.setListwithTitleHtml("Disadvantages", algorithms.disadvantages),
defination: Helper.setHeader(algorithmsData.defination),
characteristics: Helper.setListwithTitleHtml("What are the Characteristics of an Algorithm", algorithmsData.characteristics),
properties: Helper.setListwithTitleHtml("Properties of Algorithm", algorithmsData.properties),
types: Helper.setListwithTitleHtml("Types of Algorithm", algorithmsData.types),
others: Helper.setListwithTitleHtml("How to Design an Algorithm", algorithmsData.others),
advantages: Helper.setListwithTitleHtml("Advantages", algorithmsData.advantages),
disadvantages: Helper.setListwithTitleHtml("Disadvantages", algorithmsData.disadvantages),
}
3 changes: 3 additions & 0 deletions src/app/helper/helper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RouterLinkData } from "../shared/interfaces/meta-data.interface";

export class Helper{
static setListwithTitleHtml(title: string, list:string[]): string{
let listHtml = `<h4>${title}</h4>`;
Expand All @@ -17,4 +19,5 @@ export class Helper{
static setHeader(header:string):string {
return `<p>${header}</p>`
}

}
8 changes: 8 additions & 0 deletions src/app/layout/algorithm/algorithm.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ <h1 class="text-center mt-4 pt-3">Algorithms</h1>
<div class="mt-md-4 mt-3" [innerHtml]="algorithmMetaData.characteristics"></div>
<div class="mt-md-4 mt-3" [innerHtml]="algorithmMetaData.properties"></div>
<div class="mt-md-4 mt-3" [innerHtml]="algorithmMetaData.types"></div>
<div class="mt-md-4 mt-3 d-flex align-items-center horizontal-scroll">
<ng-container *ngFor="let data of algorithms; let i = index">
<div *ngIf="i !=0" class="box p-lg-2 p-1 px-lg-3 px-2 tab me-lg-4 me-3" [routerLink]="data.route">
<p class="m-0">{{data.name}}</p>
</div>
</ng-container>

</div>
<div class="mt-md-4 mt-3" [innerHtml]="algorithmMetaData.others"></div>
<div class="mt-md-4 mt-3" [innerHtml]="algorithmMetaData.advantages"></div>
<div class="mt-md-4 mt-3" [innerHtml]="algorithmMetaData.disadvantages"></div>
Expand Down
2 changes: 2 additions & 0 deletions src/app/layout/algorithm/algorithm.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { algorithmMetaData } from 'src/app/core/algorithms/algorithms-meta-data';
import { algorithms } from 'src/app/core/meta-data/router-meta-data';

@Component({
selector: 'app-algorithm',
Expand All @@ -9,6 +10,7 @@ import { algorithmMetaData } from 'src/app/core/algorithms/algorithms-meta-data'
})
export class AlgorithmComponent implements OnInit {
algorithmMetaData = algorithmMetaData;
algorithms = algorithms;
constructor(
private location: Location
) { }
Expand Down

0 comments on commit 462cdf8

Please sign in to comment.