KYA's Data Structure Adventures

In-Depth Looks

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 5731 Views - Last Post: 21 January 2011 - 12:01 PM Rate Topic: -----

Replies To: KYA's Data Structure Adventures

#2 JackOfAllTrades  Icon User is online

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,217
  • Joined: 23-August 08

Re: KYA's Data Structure Adventures

Posted 23 November 2009 - 08:40 PM

*
POPULAR

Data Structures covered so far:

An In-Depth Look At Linked Lists
An In-Depth Look At Binary Search Trees
An In-Depth Look at Hash Tables
An Application of Suffix Arrays (in Java, but highly relevant)
An In-Depth Look at Binary Heaps
An In-Depth Look At Huffman Encoding




Original Post by JackOfAllTrades:
The brilliant KYA has created an outstanding treatise on linked list processing in C++.

If you're learning linked lists and are finding it daunting, then YOU MUST READ THIS BLOG ENTRY!!! It's EVEN. GOT. PICTURES!

*NickDMax Edit: fixed link

This post has been edited by KYA: 19 January 2011 - 12:22 PM

Was This Post Helpful? 7
  • +
  • -

#3 Mowgef  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 245
  • Joined: 01-May 09

Re: KYA's Data Structure Adventures

Posted 24 November 2009 - 07:24 PM

I love pictures.
Was This Post Helpful? 0
  • +
  • -

#4 nathanpc  Icon User is offline

  • SCIENCE!
  • member icon

Reputation: 112
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Re: KYA's Data Structure Adventures

Posted 25 November 2009 - 08:32 AM

View PostMowgef, on 24 Nov, 2009 - 06:24 PM, said:

I love pictures.

I too! :D
Was This Post Helpful? 0
  • +
  • -

#5 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3089
  • View blog
  • Posts: 19,137
  • Joined: 14-September 07

Re: KYA's Data Structure Adventures

Posted 25 November 2009 - 03:34 PM

Updated the original post with the latest and greatest entry: An In-Depth Look At Binary Search Trees
Was This Post Helpful? 0
  • +
  • -

#6 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 854
  • View blog
  • Posts: 2,338
  • Joined: 20-August 07

Re: KYA's Data Structure Adventures

Posted 11 December 2009 - 03:53 AM

It recently occurred to me that the introduction of shared_ptr to the standard library has the potential to make these learning exercises more accessible, moving the focus away from explicit memory management (and other rules/idioms which go along with them such as Rule of 3 and RAII); instead the focus stays firmly on to data structures themselves as way to understand the high level concepts at least
#include <memory>
struct node;
typedef std::tr1::shared_ptr<node> ptr_t;

struct node
{
    int data;
    ptr_t next;
    node(int d, ptr_t n) 
        : data(d), next(n) {}
}; 
class Stack
{
    ptr_t head;
    Stack(const Stack&) {}   //Unfortunately not copyable
    Stack& operator=(const Stack&) {}
public:
    Stack () {}
    void push(const int& obj) 
    { 
        head.reset(new node(obj, head)); 
    }
    void pop() 
    { 
        head = head->next; 
    }
    bool empty() const 
    { 
        return head == ptr_t(); 
    }
    int& top() const 
    { 
        return head->data; 
    }
}; 

This post has been edited by Bench: 11 December 2009 - 05:07 AM

Was This Post Helpful? 0
  • +
  • -

#7 Renagado  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 116
  • View blog
  • Posts: 388
  • Joined: 14-June 09

Re: KYA's Data Structure Adventures

Posted 19 February 2010 - 12:56 PM

Wanted to read those after I saw them a while ago, but the links are broken after we changed to the new server. The new links are:

An In-Depth Look At Linked Lists

An In-Depth Look At Binary Search Trees

Great tutorials btw, thanks KYA.
Was This Post Helpful? 0
  • +
  • -

#8 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3089
  • View blog
  • Posts: 19,137
  • Joined: 14-September 07

Re: KYA's Data Structure Adventures

Posted 19 February 2010 - 12:57 PM

Thanks for that. [I forgot :/] I'll edit the OP.
Was This Post Helpful? 0
  • +
  • -

#9 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3089
  • View blog
  • Posts: 19,137
  • Joined: 14-September 07

Re: KYA's Data Structure Adventures

Posted 23 May 2010 - 05:15 PM

Updated, now with Hash Tables!
Was This Post Helpful? 0
  • +
  • -

#10 taylorc8  Icon User is offline

  • B&

Reputation: 149
  • View blog
  • Posts: 1,572
  • Joined: 21-July 09

Re: KYA's Data Structure Adventures

Posted 24 May 2010 - 01:22 PM

Some day, I'm going to be just like KYA.
Was This Post Helpful? 0
  • +
  • -

#11 kidicarus  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 136
  • Joined: 13-February 09

Re: KYA's Data Structure Adventures

Posted 24 May 2010 - 02:19 PM

Do you feel that learning data structures in one language, like C++, carries over pretty easily to other languages like Java? Surely a lot of the conceptual aspects of the algorithms do.
Was This Post Helpful? 0
  • +
  • -

#12 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1046
  • View blog
  • Posts: 4,449
  • Joined: 09-June 09

Re: KYA's Data Structure Adventures

Posted 24 May 2010 - 02:26 PM

object oriented programming is a tricky concept, but once you have grasped that concept then the
transition of OOP to other languages comes with ease. The concept of OOP doesnt vary too much
from language to language
Was This Post Helpful? 0
  • +
  • -

#13 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3089
  • View blog
  • Posts: 19,137
  • Joined: 14-September 07

Re: KYA's Data Structure Adventures

Posted 24 May 2010 - 02:30 PM

View Postkidicarus, on 24 May 2010 - 02:19 PM, said:

Do you feel that learning data structures in one language, like C++, carries over pretty easily to other languages like Java? Surely a lot of the conceptual aspects of the algorithms do.



Concept is exactly the same, it differs in the fine details (memory management, some syntax, etc...)
Was This Post Helpful? 0
  • +
  • -

#14 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10183
  • View blog
  • Posts: 37,596
  • Joined: 27-December 08

Re: KYA's Data Structure Adventures

Posted 24 May 2010 - 02:33 PM

View Postkidicarus, on 24 May 2010 - 05:19 PM, said:

Do you feel that learning data structures in one language, like C++, carries over pretty easily to other languages like Java? Surely a lot of the conceptual aspects of the algorithms do.


If you can do it in C++ and you have a fairly good handle on Java syntax, then you shouldn't have any problem whatsoever implementing your data structure in Java, as you have a lot less to worry about in the lower levels like memory management. If you look at my Linked List Tutorial in Java vs. the Linked List Class snippet in C++, you will see differences beyond basic syntax in implementations for the same concept.
Was This Post Helpful? 0
  • +
  • -

#15 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3089
  • View blog
  • Posts: 19,137
  • Joined: 14-September 07

Re: KYA's Data Structure Adventures

Posted 21 December 2010 - 12:33 PM

Updated, now with Binary Heaps!
Was This Post Helpful? 2
  • +
  • -

#16 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3089
  • View blog
  • Posts: 19,137
  • Joined: 14-September 07

Re: KYA's Data Structure Adventures

Posted 19 January 2011 - 12:23 PM

Updated, now with Huffman Encoding!
Was This Post Helpful? 2
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2