When run it, segment fault.
What is wrong?
#include <stdio.h>
#include <stdlib.h>
const int max =20;
//****************************************************
// Input Matrix
//****************************************************
void inMatrixAA(int *AA, int row, int col)... (9 Replies)
Hi,
I am using bash. My question concerns cutting out segments of a string. Given the following filename:
S2002254132542.L1A_MLAC.x.hdf
I have been able to successfully separate the string at the periods (.):
$ L1A_FILE=S2002254132542.L1A_MLAC.x.hdf
$ BASE=$(echo $L1A_FILE | awk -F.... (5 Replies)
I need help in removing a leading zero in a particular position.
For eg.: XYZ*04567472*0099*020091231*0123*0.12
In the above line, I want to replace "*0123" with "123" and "0.12" with ".12". I want to remove the leading zero only in position number 4 and 5 (the bolded segments)
I was able... (10 Replies)
I mean, I malloc a segment of memory, maybe 1k maybe 20bytes.. assume the pointer is pMem How can I know the content pMem refered is all Zero or \0 . I know memcmp but the second parameter should another memory address... thanx (4 Replies)
Hi,
Whether the following piece of code is placed in the read-only memory of code (text) segment or data segment?
char *a = "Hello";
I am getting two different answers while searching in google :( that's why the confusion is (7 Replies)
I always get segment fault, why? can sb help me and modify it, I have spend on much time on
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <string.h>
#define MAX 10
pthread_t thread;
void *thread1()
{
int *a;
int i, n;
... (1 Reply)
I have a file with a combination of binary characters and words, and need to trim out the segment i.e. SleeperThreadAborting {{username::RAB2002}} {{scriptname::scs_get_pending_by_loc}} and put the lists into a text file.
Luckily, the segment I am looking for i.e. has readable words ... (8 Replies)
Discussion started by: Daniel Gate
8 Replies
LEARN ABOUT DEBIAN
tree::redblack
RedBlack(3pm) User Contributed Perl Documentation RedBlack(3pm)NAME
Tree::RedBlack - Perl implementation of Red/Black tree, a type of balanced tree.
SYNOPSIS
use Tree::RedBlack;
my $t = new Tree::RedBlack;
$t->insert(3, 'cat');
$t->insert(4, 'dog');
my $v = $t->find(4);
my $min = $t->min;
my $max = $t->max;
$t->delete(3);
$t->print;
DESCRIPTION
This is a perl implementation of the Red/Black tree algorithm found in the book "Algorithms", by Cormen, Leiserson & Rivest (more commonly
known as "CLR" or "The White Book"). A Red/Black tree is a binary tree which remains "balanced"- that is, the longest length from root to
a node is at most one more than the shortest such length. It is fairly efficient; no operation takes more than O(lg(n)) time.
A Tree::RedBlack object supports the following methods:
new ()
Creates a new RedBlack tree object.
root ()
Returns the root node of the tree. Note that this will either be undef if no nodes have been added to the tree, or a
Tree::RedBlack::Node object. See the Tree::RedBlack::Node manual page for details on the Node object.
cmp (&)
Use this method to set a comparator subroutine. The tree defaults to lexical comparisons. This subroutine should be just like a
comparator subroutine to sort, except that it doesn't do the $a, $b trick; the two elements to compare will just be the first two items
on the stack.
insert ($;$)
Adds a new node to the tree. The first argument is the key of the node, the second is its value. If a node with that key already
exists, its value is replaced with the given value and the old value is returned. Otherwise, undef is returned.
delete ($)
The argument should be either a node object to delete or the key of a node object to delete. WARNING!!! THIS STILL HAS BUGS!!!
find ($)
Searches the tree to find the node with the given key. Returns the value of that node, or undef if a node with that key isn't found.
Note, in particular, that you can't tell the difference between finding a node with value undef and not finding a node at all. If you
want to determine if a node with a given key exists, use the node method, below.
node ($)
Searches the tree to find the node with the given key. Returns that node object if it is found, undef otherwise. The node object is a
Tree::RedBlack::Node object.
min ()
Returns the node with the minimal key.
max ()
Returns the node with the maximal key.
AUTHOR
Benjamin Holzman <bholzman@earthlink.net>
SEE ALSO
Tree::RedBlack::Node
perl v5.10.0 2008-07-31 RedBlack(3pm)