Karthikeya Boyini has Published 2193 Articles

Clearing the elements of the PriorityQueue using Javascript

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 09:12:27

139 Views

We can clear the contents just by reassigning the container element to an empty array. For example,  clear() {    this.container = []; }ExampleYou can check if this function is working fine using − let q = new PriorityQueue(4); q.enqueue("Hello", 3); q.enqueue("World", 2); q.enqueue("Foo", 8); q.display(); q.clear(); q.display();OutputThis will give the ... Read More

Creating a linked list using Javascript

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 09:07:26

299 Views

Let's start by defining a simple class with a constructor that initializes the head to null. We'll also define another structure on the prototype of the LinkedList class that'll represent each node in the linked list.Exampleclass LinkedList {    constructor() {       this.head = null;       ... Read More

Peeking elements from a Queue in Javascript

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 08:57:26

625 Views

Peeking a Queue means getting the value at the head of the Queue. So we can implement the peek function as follows − EXamplepeek() {    if (isEmpty()) {       console.log("Queue Underflow!");       return;    }    return this.container[0]; }You can check if this function is working ... Read More

The Queue Class in Javascript

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 08:55:35

272 Views

Here is the complete implementation of the Queue class −Exampleclass Queue {    constructor(maxSize) {       // Set default max size if not provided       if (isNaN(maxSize)) {          maxSize = 10;       }       this.maxSize = maxSize;   ... Read More

Creating a Priority Queue using Javascript

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 08:54:25

511 Views

Our class will have the following functions −enqueue(element): Function to add an element in the queue.dequeue(): Function that removes an element from the queue.peek(): Returns the element from the front of the queue.isFull(): Checks if we reached the element limit on the queue.isEmpty(): checks if the queue is empty.clear(): Remove ... Read More

Popping elements from a Stack in Javascript

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 08:38:10

296 Views

Consider a simple stack class in Javascript.Exampleclass Stack {    constructor(maxSize) {       // Set default max size if not provided       if (isNaN(maxSize)) {          maxSize = 10;       }       this.maxSize = maxSize; // Init an array ... Read More

Clearing the elements of a Stack in Javascript

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 08:31:33

956 Views

Consider a simple stack class in Javascript. Exampleclass Stack {    constructor(maxSize) {       // Set default max size if not provided       if (isNaN(maxSize)) {          maxSize = 10;       }       this.maxSize = maxSize; // Init an array ... Read More

SAP UI5 framework and comparison with JQuesry and Backbone, Angular, etc.

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 07:32:18

224 Views

The SAPUI5 framework is the original version of the SAP toolkit which was released initially. This version of the toolkit is a proprietary version. Later SAP released an Open source version of it named OpenUI5. Functionally it is almost equivalent in terms of basic operations negating few features but overall ... Read More

Disable a pagination link with Bootstrap

karthikeya Boyini

karthikeya Boyini

Updated on 15-Jun-2020 06:23:56

1K+ Views

Use the .disabled class in Bootstrap with the .pagination to disable a pagination link.You can try to run the following code to disable pagination linkExampleLive Demo           Bootstrap Example                                              Java Tutorial          The following are the lessons of Java Tutorial:                       1             2             3             4             5             6             7             8                    

HTML DOM Input Month max Property

karthikeya Boyini

karthikeya Boyini

Updated on 13-Jun-2020 08:45:30

157 Views

The HTML DOM input month max property returns and modify the value of the max attribute of the input field of type=”month” in a HTML document.SyntaxFollowing is the syntax −1. Returning maxobject.max2. Modifying maxobject.max = “YYYY-MM”Here, YYYY represent year and MM represent month like “2019-02”ExampleLet us see an example of ... Read More

Advertisements