HTML DOM Input Password Required Property

AmitDiwan
Updated on 22-Aug-2019 09:04:18

187 Views

The HTML DOM input password required property is associated with the required attribute of an element. The required property is used for setting and returning if it is necessary to fill some password field or not before the form is submitted to the server. This allows the form to not submit if a password field with required attribute is left empty by the user.SyntaxFollowing is the syntax for −Setting the required property −textObject.required = true|falseHere, true represents the text field must be filled while false represents its optional to fill the field before submitting the form.ExampleLet us look at ... Read More

Print Nodes of Linked List at Given Indexes in C Language

Sunidhi Bansal
Updated on 22-Aug-2019 09:00:19

6K+ Views

We have to print the data of nodes of the linked list at the given index. Unlike array linked list generally don’t have index so we have to traverse the whole linked list and print the data when we reached a particular.Let’s say, list contains the nodes 29, 34, 43, 56 and 88 and the value of indexes are 1, 2 and 4 than the output will be the nodes at these indexes that are 34, 43 and 88.ExampleLinked list: 29->34->43->56->88 Input: 1 2 4 Output: 34 43 88In above representation of Linked List the yellow highlighted nodes are the ... Read More

Print N x N Spiral Matrix Using O(1) Extra Space in C

Sunidhi Bansal
Updated on 22-Aug-2019 09:00:13

507 Views

We are given an positive integer n and make a spiral matrix of n x n, with only using O(1) extra space in clockwise directionSpiral matrix is a matrix that works like a spiral which will start from the origin of a circle and rotates in clockwise fashion. So the task is to print the matrix in spiral form using O(1) space starting from 2 → 4 → 6 → 8 → 10 → 12 → 14 → 1 6→ 18.Given below is the example of spiral matrix −ExampleInput: 3 Output:    9 8 7    2 1 6   ... Read More

Print Last K Nodes of Linked List in Reverse Order using Iterative Approach in C

Sunidhi Bansal
Updated on 22-Aug-2019 08:56:14

285 Views

We have to print the k number of nodes of the linked list in reverse order. We have to apply the iterative approach to solve this problem.Iterative method is the one which generally uses loops that are executed till the condition holds value 1 or true.Let’s say, list contains the nodes 29, 34, 43, 56 and 88 and the value of k is 2 than the output will be the alternate nodes till k such as 56 and 88.ExampleLinked List: 29->34->43->56->88 Input: 2 Output: 56 88Since we have to remove last k elements from the list the best way to ... Read More

Print Numbers in Matrix Diagonal Pattern in C

Sunidhi Bansal
Updated on 22-Aug-2019 08:54:13

3K+ Views

The task is to print the matrix of n x n of the diagonal pattern.If n is 3 then to print a matrix in Diagonal pattern is −So the output will be like −ExampleInput: 3 Output:    1 2 4    3 5 7    6 8 9 Input: 4 Output:    1 2 4  7    3 5 8 11    6 9 12 14    10 13 15 16The problem suggests we have to give a number n and generate a matrix of n x n and then we have to traverse the matrix in a diagonal pattern ... Read More

Print Last K Nodes of Linked List in Reverse Order using Recursive Approaches in C

Sunidhi Bansal
Updated on 22-Aug-2019 08:53:14

183 Views

The task is to print the k nodes starting from the end of the linked list using recursive approach.Recursive approach is the one in which the function call itself again and again till the call is being made and hence stores the result.Let’s say, list contains the nodes 29, 34, 43, 56 and 88 and the value of k is 2 than the output will be the last k nodes such as 56 and 88.ExampleLinked List: 29->34->43->56->88 Input: 2 Output: 88 56As specified the recursive approach should be used which will traverse the list from the end keeping track of ... Read More

HTML DOM Input Password ReadOnly Property

AmitDiwan
Updated on 22-Aug-2019 08:52:39

179 Views

The HTML DOM Input Password readOnly property is used for setting or returning whether the input password field is read-only or not. The readOnly property makes the element non-editable but it can still be focused by tab or by clicking. If there is a default value inside a read-only element then it is sent to server on submit.SyntaxFollowing is the syntax for −Set the readOnly property −passwordObject.readOnly = true|falseHere, true represents the password field is read only while false represents otherwise. The readOnly property is set to false by default.ExampleLet us look at an example for the password readOnly property ... Read More

Print Alternate Nodes of Linked List Using Iterative Method in C

Sunidhi Bansal
Updated on 22-Aug-2019 08:50:52

1K+ Views

In this problem, program must print the alternates from the given linked list that is leaving one printing other and so on using iterative method.Iterative method is the one which generally uses loops that are executed till the condition holds value 1 or true.Let’s say, list contains the nodes 29, 34, 43, 56 and 88 and than the output will be the alternate nodes such as 29, 43 and 88.ExampleInput: 29->34->43->56->88 Output: 29 43 88The approach is to traverse the entire list till the last node. While, traversing a counter variable can be taken which is incremented to 1 and ... Read More

MySQL Binary Data Insertion: Choosing the Right Data Type

AmitDiwan
Updated on 22-Aug-2019 08:48:59

663 Views

For this, use BIT data type. Let us first create a table −mysql> create table DemoTable(binaryValue BIT(5)); Query OK, 0 rows affected (0.83 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(15); Query OK, 1 row affected (0.15 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output. Now you can see the records aren’t visible −+-------------+ | binaryValue | +-------------+ |             | |           ... Read More

Print Reverse of a Linked List Without Actually Reversing in C

Sunidhi Bansal
Updated on 22-Aug-2019 08:48:12

365 Views

The task is to print the reverse of a given linked list by using recursive function. The program must print the reverse but not reverse the list that means the order of the nodes remains the sameHere, the program will move head pointer containing the address of a first node to next node until the NULL is examined which is stored in last node of a list and printing the data of a head node.ExampleInput: 29 34 43 56 Output: 56 43 34 29Firstly, the nodes are inserted into the list and a pointer will start pointing to the nodes ... Read More

Advertisements