Make Responsive Travel Website

Responsive Tour & Travel Website Tutorial Learn HTML CSS JS. I will teach you how to make a responsive website in this tutorial. You will be able to see the changes you make in real-time on your computer. It is very easy to follow and very helpful for those who are just starting out. Make Responsive Travel Website – Tour Website – Travel Sites – Learn HTML CSS JavaScript

This tutorial will help you learn to make a responsive website for free. Join over 60,000 people that view our videos and make your own responsive website for free for your next business or personal website.

Bidirectional linked list

The append operation in our previous code was O(n), looping over and over again. Besides, it was not possible to traverse the linked list from the opposite direction.

The linked list in the above image uses two pointers per node. The prev pointer points to the address of the previous node of each node. Also we are remembering the address of the last node with the help of tail pointer.

Now adding new nodes at the end of linked list is possible in O(1) complexity.

Now the append function has become very easy. The new node is added to the tail and the tail is moved forward by one position. There is no need to keep the previous_node variable even when deleting a node.

Binary search tree

Another use of linked lists is to create trees of various types. A binary search tree is constructed as follows:

In a binary search tree, the leftmost node always has a smaller value, and the rightmost node always has an equal or greater value. We need two pointers named left and right.

While inserting a new node, loop back to the last node as before. Whether to go left or right while executing the loop should be determined by comparing the value of the node and the new value.

Make Responsive Travel Website – Tour Website – Travel Sites – Learn HTML CSS JavaScript

Write a print function to check whether the code is correct:

This function will recursively print the values of the nodes.

If you understand the code then write the function to delete the node from the binary search tree. There are several cases to consider while deleting nodes, I will not discuss them here. You can learn it from Korman’s Algorithm book or by doing a little google search.

Read this article of mine to know how to find bicycle in linked list. A very nice implementation of linked list is LRU Cash, read this article for details.

There are some common mistakes that are made when writing linked list code at the beginning. For example, trying to print the value after the pointer value has become null, or trying to advance further, the code will throw a run-time error. Besides, forgetting to free memory is also a very common mistake. Another mistake is to change the root or tail pointer value.

After learning linked list, you should learn to implement data structures like stack, queue, binary tree, heap etc. with linked list. If you are contesting and want to learn something a little more advanced, then you can learn how to implement a tri data-structure using a linked list from here.

Happy Coding!

Algorithm Game Theory-2 (nim game)

In the previous episode we learned some basics of game theory, in this episode we will learn about nim-game. Nim-Games are very important because many types of games can be converted into Nim games.

Nim-game consists of two players and some piles of stones. Each move a player can take one or more stones from any pile. If one fails to make a move, one loses. That is, whoever picks up the last stone wins the game.

Above image shows 3 piles of stones, first one has 6 stones, second one has 9 stones and third one has 3 stones.

Like the previous games here also every player will play optimally, no one will make any wrong move. You have to see how many stones are in each pile and tell if the first player wins or loses.

Now consider n

A stack contains stones a1,a2…..,an respectively. The first player in the game loses only if xorsum=a1⊕a2⊕….⊕an=0

is Here ⊕ stands for xor operator.

Make Responsive Travel Website – Tour Website – Travel Sites – Learn HTML CSS JavaScript

In the above image example xorsum=6⊕9⊕3=12!=0

. Here xorsum is not zero, so playing optimally cannot defeat the first player.

Now the question is why and how it works? xorsum=0

If there is a losing state then the current player will take the game to a winning state no matter what moves they make.

Assume n=4

and the set of numbers of stones in piles {9,7,11,5}

. Write them in binary as follows:

1 0 0 1 (= 9)

0 1 1 1 (= 7)

1 0 1 1 (= 11)

0 1 0 1 (= 5)

We put the binary numbers in a 4×4

Think of it as a grid. Note that every column has an even number of 1’s, so xorsum=0, this is a losing state. Now the current player chooses a stack and picks up some stones. However he does this, at least 1 1 in a row must change to a 0. As a result at least one column will have an odd number of 1’s and xorsum>0

will be

That means xorsum=0 in current state

If you don’t give rice anyway xorsum>0

will be

Now at current state if xorsum>0

Then it can be shown that it is possible for the current player to make a move such that the game goes to the losing state, i.e., xorsum=0.

becomes

Consider the set of stone numbers {5,14,9,5}

.

0 1 0 1 =(5)

1 1 1 0 =(14)

1 0 0 1 =(9)

0 1 0 1 = (5)

2nd and 3rd column from left are odd number of 1’s

Yes, so xorsum will be >0. Now I want to move such that xorsum=0. So first we will find the leftmost column which has odd number 1, in this case it is 2nd column. Now select a row that has 1 in the 2nd column, in this case it can be the first, second or fourth row. Now change the 1 in the 2nd column of that row to a 0 and change the 0 or 1 in the other columns so that each column has an even number of stones. Then xorsum=0

Done!

That means xorsum>0 at current state

Then the current player can easily make a move such that xorsum=0

becomes

Then it appears that the losing state (xorsum=0

) can only go to the winning state (xorsum>0) regardless of the move, and if you play wisely, you can always go from the winning state (xorsum>0) to the losing state (xorsum=0). So initially xorsum>0

Make Responsive Travel Website – Tour Website – Travel Sites – Learn HTML CSS JavaScript

Before Download

You must Join our Facebook Group and Subscribe YouTube Channel

All Links in Below:






Join Our FreeWebsiteCreate Facebook Group to get an instant update for projects, templates, design resources, and solutions.

Join Our YouTube Channel & Subscribe with Bell Icon for New Video:

Join Our Official Facebook Page For the Latest updates All Code Projects are Free:

Visit our service page to get premium services.

Free Website Create – HTML CSS, PHP, JavaScript Programming Projects For Free

Follow Us

Thank You,

Stay with FreeWebsiteCreate.net

Share the post if necessary.

Before Download

You must Join our Facebook Group and Subscribe YouTube Channel




FreeWebsiteCreate.net tries to provide HTML, CSS, SCSS, JavaScript, React, Android Studio, Java, PHP, Laravel, Python, Django, C#(C Sharp), and ASP.net-related projects 100% free. We try to make learning easier. Free Website Create always tries to give free projects to those who are new learners. Free projects and source code will help to learn easily.

They can save time and learn more. In this post, we share a free portfolio project website code with HTML and CSS. This free code portfolio contains a single landing page with a responsive design. In this post, we get a free best carpenter and craftsman service website designed by FreeWebsiteCreate with HTML, CSS, Bootstrap, and JavaScript.

To get a free website project code,

Keep bookmarking our website, Save categories links, Follow Social Media, Follow the youtube channel Join Facebook groups.

Stay with FreeWebsiteCreate.net

Share the post if necessary.

Leave a Comment