/images/avatar.png

Linked List Basics

A linked list is a data structure for storing, searching, manipulating and doing many more with a list of data. ‘Array’ data structure has some limitations that can be overcome easily by the linked list having some dynamic features. Let’s see what a linked list can do – Successive elements are connected by pointers. Last element points to NULL. It can grow or shrink in size during execution of a program.

Writing a Parser using (F)LEX and YACC/BISON

1 Task Description We will implement few statements found in C. We will call this language SubC. Given the grammar of SubC we will write the F(LEX) and YACC/BISON specification file that parses code written in SubC. We will generate a parser for only assignment statements. Following is the grammar for assignment statements for SubC. 1 2 3 4 5 6 7 Stmt_list → Stmt | Stmt_list ; Stmt Stmt → Variable **assignop** Expression Variable → **id** | **id** [Expression] Expression → Simple_expression | Simple_expression **relop** Simple_expression Simple_expression → Term | Simple_expression **addop** Term Term → Factor | Term **mulop** Factor Factor → **id** | **num** | ( Expression) | **id** [Expression] | **not** Factor Tokens/Terminal symbols of this grammar are in BOLD font.

PostgreSQL Installation and DB Creation on Ubuntu 16.04

Installation Note: This installation procedure is based on Ubuntu 16.04, for other versions see [https://www.postgresql.org/download/linux/ubuntu/] Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository 1 $ echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list Import the repository signing key, and update the package lists 1 $ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - Ubuntu includes PostgreSQL by default. To install PostgreSQL on Ubuntu, use the apt-get (or other apt-driving) command 1 2 $ sudo apt-get update $ sudo apt-get install postgresql-9.