4 Replies - 2854 Views - Last Post: 11 January 2012 - 11:14 AM

#1 jone kim  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 55
  • Joined: 07-January 10

implementation of different algorithms and data structures

Posted 09 January 2012 - 04:12 PM

There are different data structures and algorithms I've read.
Like:

SORTING
bubble sort, insertion sort, heap sort, quick sort, selection sort etc.

SEARCHING
BFS, DFS, Binary Search, A* Search etc.

MERGING
Simple Merge etc.

and many other data structures and algorithms.

What are the applications of these algorithms and data structures in building websites? Where can we implement these algorithms in building efficient websites?

Generally in building dynamic websites, we rely on database system and write queries for retrieving required information. So where can we implement these data structures in building websites??

Can anyone elaborate me the use of the data structures and algorithms in building efficient websites? Is there any e-book to learn about this stuff??

Is This A Good Question/Topic? 1
  • +

Replies To: implementation of different algorithms and data structures

#2 macosxnerd101  Icon User is online

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12151
  • View blog
  • Posts: 45,177
  • Joined: 27-December 08

Re: implementation of different algorithms and data structures

Posted 09 January 2012 - 06:18 PM

*Moved to Web Development*

Generally, you won't be using these algorithms and data structures when developing websites. Most languages have libraries and functions to handle a good deal of the basics (arrays, linked lists, stacks and queues, searching and sorting), and the more advanced algorithms and data structures aren't applicable. You might use a DFS or BFS if you are writing a web crawler. But other than that, good SQL queries can abstract the algorithms. You could query a database for the shortest path from A to B, eliminating the need to implement Dijkstra's algorithm.

You would get more into it if you were talking about using a B-Tree to pack a relational database engine, for example.
Was This Post Helpful? 0
  • +
  • -

#3 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 345
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: implementation of different algorithms and data structures

Posted 10 January 2012 - 02:21 PM

I believe most of these algorithms are more common in programming rather than website development, however I am not greatly experienced in backend coding. So if anybody does know of uses when these algorithms are particularly useful to know then please share your experiences! I expect search engines would use them the most.

I believe most of these algorithms are more common in programming rather than website development, however I am not greatly experienced in backend coding. So if anybody does know of uses when these algorithms are particularly useful to know then please share your experiences! I expect search engines would use them the most.
Was This Post Helpful? 0
  • +
  • -

#4 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1439
  • View blog
  • Posts: 3,609
  • Joined: 28-November 09

Re: implementation of different algorithms and data structures

Posted 11 January 2012 - 01:19 AM

It entireley depends on the amount of data you need to work with. Some algorithms have an insane efficiency with large sets of data and choke and small bits. Then again, scalability being the ultimate goal of any application, you only have to switch methods at certain levels of data and it should be fine.

Look up the orders of efficiency of each of these algorithms and you'll be able to gain a greater understanding of what they are used best for.
Was This Post Helpful? 0
  • +
  • -

#5 blackcompe  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1159
  • View blog
  • Posts: 2,547
  • Joined: 05-May 05

Re: implementation of different algorithms and data structures

Posted 11 January 2012 - 11:14 AM

Quote

What are the applications of these algorithms and data structures in building websites?


They're used in AJAX libraries for rich thin clients to implement the dynamic searching and sorting of data sets in the client view. See this working example. If you click the column header, the data is sorted accordingly. I highly doubt A* search is used here, but quicksort, definitely. That's just an application though, nothing to do with the system's efficiency.

Data structures and algorithms could be used in the middle tier of an enterprise system (which could have a web browser interface) if your business logic calls for it. They could be used in logistics (Dijkstra's algorithm to find the quickest route for delivering a product), operations research (graph theory, simulation, math/stats algorithms to maximize profits), and whatever else fits the bill. Again, not much to do with efficiency outside the business logic.

Quote

Where can we implement these algorithms in building efficient websites?


As stated already, data structures play a big role in efficient database implementation. Your common website is a database-driven CRUD application: they manipulate databases mostly. For these types of applications, algorithms aren't usually needed by the developer.

Algorithms are used in load balancers.

Quote

A variety of scheduling algorithms are used by load balancers to determine which backend server to send a request to. Simple algorithms include random choice or round robin. More sophisticated load balancers may take into account additional factors, such as a server's reported load, recent response times, up/down status (determined by a monitoring poll of some kind), number of active connections, geographic location, capabilities, or how much traffic it has recently been assigned. High-performance systems may use multiple layers of load balancing.
~ Load Balancing

Load balancing doesn't really belong in the same category as a web application, but it's a part of the entire web system and helps to increase efficiency. I felt load balancing was revelant because software load balancers can be plugged into a web server (Apache's mod_proxy_balancer), and thus becomes much more important in the software realm of the web system. This talks about Apache's scheduler algorithm.

Round Robin, FIFO, and SJF scheduling are borrowed from the implementation of operating systems, and I know they (can) use linked lists. Scheduling according to geographic location sounds like an application of graph algorithms.

Distributed computing, caching, and multithreading are all other ways to help scalability issues.

This post has been edited by blackcompe: 11 January 2012 - 11:28 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1